Skip to content

Commit 1bccb85

Browse files
authored
Hosting Dashboard Plugins: Make tracking events non interpolated (#106096)
1 parent 1e5638d commit 1bccb85

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

client/dashboard/plugins/manage/components/action-render-modal.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,13 @@ export default function ActionRenderModal( {
199199
const { recordTracksEvent } = useAnalytics();
200200

201201
useEffect( () => {
202-
recordTracksEvent( `calypso_hosting_dashboard_plugins_${ actionId }_click` );
202+
recordTracksEvent( 'calypso_dashboard_plugins_action_click', { action_id: actionId } );
203203
}, [ actionId, recordTracksEvent ] );
204204

205205
const handleCancel = () => {
206-
recordTracksEvent( `calypso_hosting_dashboard_plugins_${ actionId }_cancel_click` );
206+
recordTracksEvent( 'calypso_dashboard_plugins_action_cancel_click', {
207+
action_id: actionId,
208+
} );
207209
closeModal?.();
208210
};
209211

@@ -420,7 +422,9 @@ export default function ActionRenderModal( {
420422
};
421423

422424
const handleConfirm = async () => {
423-
recordTracksEvent( `calypso_hosting_dashboard_plugins_${ actionId }_confirm_click` );
425+
recordTracksEvent( 'calypso_dashboard_plugins_action_confirm_click', {
426+
action_id: actionId,
427+
} );
424428
setIsBusy( true );
425429
try {
426430
const { successCount, errorCount } = await onExecute( items );

client/dashboard/plugins/plugin/components/field-action-toggle.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ export default function FieldActionToggle( {
4747
}
4848
} }
4949
onChange={ ( next ) => {
50-
recordTracksEvent(
51-
`calypso_hosting_dashboard_plugins_${ actionId }_toggle_${
52-
next ? 'enable' : 'disable'
53-
}_click`
54-
);
50+
recordTracksEvent( 'calypso_dashboard_plugins_toggle_click', {
51+
action_id: actionId,
52+
next_state: next ? 'enable' : 'disable',
53+
} );
5554
onToggle( next )
5655
.then( () => {
5756
createSuccessNotice( next ? successOn : successOff, { type: 'snackbar' } );

0 commit comments

Comments
 (0)