diff --git a/plugins/woocommerce-admin/changelogs/add-8073-add-inbox2-click-event b/plugins/woocommerce-admin/changelogs/add-8073-add-inbox2-click-event new file mode 100644 index 00000000000..c86ad1e4eef --- /dev/null +++ b/plugins/woocommerce-admin/changelogs/add-8073-add-inbox2-click-event @@ -0,0 +1,4 @@ +Significance: patch +Type: Add + +Add inbox_action_click track when a note gets clicked #8086 diff --git a/plugins/woocommerce-admin/client/inbox-panel/index.js b/plugins/woocommerce-admin/client/inbox-panel/index.js index 679a4119572..b90bfbf5e08 100644 --- a/plugins/woocommerce-admin/client/inbox-panel/index.js +++ b/plugins/woocommerce-admin/client/inbox-panel/index.js @@ -51,6 +51,8 @@ const onBodyLinkClick = ( note, innerLink ) => { } ); }; +let hasFiredPanelViewTrack = false; + const renderNotes = ( { hasNotes, isBatchUpdating, @@ -68,9 +70,12 @@ const renderNotes = ( { return renderEmptyCard(); } - recordEvent( 'inbox_panel_view', { - total: notes.length, - } ); + if ( ! hasFiredPanelViewTrack ) { + recordEvent( 'inbox_panel_view', { + total: notes.length, + } ); + hasFiredPanelViewTrack = true; + } const screen = getScreenName(); const onNoteVisible = ( note ) => { @@ -269,6 +274,14 @@ const InboxPanel = ( { showHeader = true } ) => { const onNoteActionClick = ( note, action ) => { triggerNoteAction( note.id, action.id ); + const screen = getScreenName(); + recordEvent( 'inbox_action_click', { + note_content: note.content, + note_name: note.name, + note_title: note.title, + note_type: note.type, + screen, + } ); }; if ( isError ) {