From bdfe3520c3e73c3f626ba76a3f90d5ccef74da87 Mon Sep 17 00:00:00 2001 From: Jeff Stieler Date: Tue, 2 Jul 2019 09:18:52 -0600 Subject: [PATCH] Send tracks event for snoozing store alerts. --- .../client/layout/store-alerts/index.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce-admin/client/layout/store-alerts/index.js b/plugins/woocommerce-admin/client/layout/store-alerts/index.js index cfa73582332..97023ca6076 100644 --- a/plugins/woocommerce-admin/client/layout/store-alerts/index.js +++ b/plugins/woocommerce-admin/client/layout/store-alerts/index.js @@ -23,6 +23,7 @@ import withSelect from 'wc-api/with-select'; import { QUERY_DEFAULTS } from 'wc-api/constants'; import sanitizeHTML from 'lib/sanitize-html'; import StoreAlertsPlaceholder from './placeholder'; +import { recordEvent } from 'lib/tracks'; import './style.scss'; @@ -118,10 +119,18 @@ class StoreAlerts extends Component { }, ]; - const setReminderDate = ( newDate, onClose ) => { + const setReminderDate = ( snoozeOption, onClose ) => { return () => { onClose(); - updateNote( alert.id, { status: 'snoozed', date_reminder: newDate } ); + updateNote( alert.id, { status: 'snoozed', date_reminder: snoozeOption.newDate } ); + + const eventProps = { + alert_name: alert.name, + alert_title: alert.title, + snooze_duration: snoozeOption.newDate, + snooze_label: snoozeOption.label, + }; + recordEvent( 'store_alert_snooze', eventProps ); }; }; @@ -143,7 +152,7 @@ class StoreAlerts extends Component {