Add/8073 add action_click event to inbox 2.0 (https://github.com/woocommerce/woocommerce-admin/pull/8086)
* Prevent firing multiple panel view event * Add inbox_action_click event when a note gets clicked * Add changelog
This commit is contained in:
parent
ccd2495ff4
commit
c84a8f4d40
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: Add
|
||||||
|
|
||||||
|
Add inbox_action_click track when a note gets clicked #8086
|
|
@ -51,6 +51,8 @@ const onBodyLinkClick = ( note, innerLink ) => {
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let hasFiredPanelViewTrack = false;
|
||||||
|
|
||||||
const renderNotes = ( {
|
const renderNotes = ( {
|
||||||
hasNotes,
|
hasNotes,
|
||||||
isBatchUpdating,
|
isBatchUpdating,
|
||||||
|
@ -68,9 +70,12 @@ const renderNotes = ( {
|
||||||
return renderEmptyCard();
|
return renderEmptyCard();
|
||||||
}
|
}
|
||||||
|
|
||||||
recordEvent( 'inbox_panel_view', {
|
if ( ! hasFiredPanelViewTrack ) {
|
||||||
total: notes.length,
|
recordEvent( 'inbox_panel_view', {
|
||||||
} );
|
total: notes.length,
|
||||||
|
} );
|
||||||
|
hasFiredPanelViewTrack = true;
|
||||||
|
}
|
||||||
|
|
||||||
const screen = getScreenName();
|
const screen = getScreenName();
|
||||||
const onNoteVisible = ( note ) => {
|
const onNoteVisible = ( note ) => {
|
||||||
|
@ -269,6 +274,14 @@ const InboxPanel = ( { showHeader = true } ) => {
|
||||||
|
|
||||||
const onNoteActionClick = ( note, action ) => {
|
const onNoteActionClick = ( note, action ) => {
|
||||||
triggerNoteAction( note.id, action.id );
|
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 ) {
|
if ( isError ) {
|
||||||
|
|
Loading…
Reference in New Issue