* Prevent firing multiple panel view event

* Add inbox_action_click event when a note gets clicked

* Add changelog
This commit is contained in:
Moon 2021-12-27 00:38:31 -08:00 committed by GitHub
parent ccd2495ff4
commit c84a8f4d40
2 changed files with 20 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: Add
Add inbox_action_click track when a note gets clicked #8086

View File

@ -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 ) {