Refactor GA tracking events for module activation and setup (including Idea Hub adjustments)
See original GitHub issueAs part of redefining some of our legacy GA tracking events, this issue focuses on module activation and setup. As part of that it also touches some events relevant for Idea Hub, which should be part of the Idea Hub launch.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- All of the event categories mentioned below should technically rely on the
VIEW_CONTEXT_*
constants for their first name segment (i.e. don’t hardcode “dashboard” but use the constant instead).
Module activation and deactivation
- An
activate_module
GA event should be fired in the following places:- When clicking the button to activate a module in Settings > Connect more services (event category:
settings_module-list
). - When clicking the button to activate a module from within an
ActivateModuleCTA
(event category:dashboard_widget-activation-cta
). Note that this currently is only used by Analytics and PageSpeed Insights. - When clicking one of the buttons to activate a module from the common “success” notification on top of the dashboard which appears after successful plugin or module setup (event category:
dashboard_authentication-success-notification
). The existingmodule_activate
event that is fired there should be removed / replaced with this. - When clicking the CTA button to activate Idea Hub in the (currently) Idea Hub-specific activation prompt notification (event category:
dashboard_module-activation-notification
). Note that there is already another event there which should not be erased - both events should be fired for the same interaction, as they are relevant in different tracking contexts. - For each of the above, the module slug should be used as event label.
- When clicking the button to activate a module in Settings > Connect more services (event category:
- A
deactivate_module
GA event should be fired when confirming the disconnect dialog after clicking the button to disconnect a module from within Settings > Connected services (event category:settings_module-list
). The module slug should be used as event label.
Module setup
- A
view_module_setup
GA event should be fired whenever theModuleSetup
component is first rendered. - A
complete_module_setup
GA event should be fired whenever a module setup is completed (via thefinishSetup
callback withinModuleSetup
). - A
cancel_module_setup
GA event should be fired whenever a module setup is explicitly cancelled (via the “Cancel” button withinModuleSetup
). - For each of the above 3 events the event category should be
moduleSetup
, and the module slug should be used as event label.
Idea Hub activation prompt notification
- In addition to the extra
activate_module
event within this Idea Hub notification (see above), the existing 3 events that are currently Idea Hub-specific should all be renamed, as follows:- The event category for the three of them should be
dashboard_module-activation-notification
. - The event names should be
view_notification
,confirm_notification
, anddismiss_notification
respectively. - The event label for all three of them should be the module slug, which technically can be hard-coded to
idea-hub
here. - Just to explain why the above renaming: In the future we are going to introduce a generic component for this that also can work for other modules, but that should not be part of this issue.
- The event category for the three of them should be
Implementation Brief
- Module activation and deactivation:
- In
assets/js/components/settings/SetupModule.js
:- Add
trackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'activate_module', slug )
call to theonSetup
callback.
- Add
- In
assets/js/components/ActivateModuleCTA.js
:- Add
trackEvent( '${ VIEW_CONTEXT_DASHBOARD }_widget-activation-cta', 'activate_module', moduleSlug )
call before theonCTAClick
callback.
- Add
- In
assets/js/components/ModulesList.js
:- Update the
trackEvent
function call in thehandleSetupModule
callback to use${ VIEW_CONTEXT_DASHBOARD }_authentication-success-notification
category instead of${ slug }_setup
andactivate_module
instead ofmodule_activate
.
- Update the
- In
assets/js/modules/idea-hub/components/dashboard/DashboardCTA.js
:- Update the event names for existing
trackEvent
calls:confirm_notification
instead ofprompt_widget_setup
view_notification
instead ofprompt_widget_view
dismiss_notification
instead ofprompt_widget_dismiss
- Use
${ VIEW_CONTEXT_DASHBOARD }_module-activation-notification
as the event category andidea-hub
as the event label for updated events. - Add
trackEvent( '${ VIEW_CONTEXT_DASHBOARD }_module-activation-notification', 'activate_module', 'idea-hub' )
call to theonButtonClick
callback before navigation. It can be placed after the existingtrackEvent
call, but do not delete it or replace the existingtrackEvent
call.
- Update the event names for existing
- In
assets/js/components/settings/SettingsActiveModule/ConfirmDisconnect.js
:- Add
trackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'deactivate_module', slug )
call to thehandleDisconnect
callback.
- Add
- In
- Module setup:
- In
assets/js/components/setup/ModuleSetup.js
:- Add
useMount
hook that callstrackEvent( 'moduleSetup', 'view_module_setup', moduleSlug )
. - Add
trackEvent( 'moduleSetup', 'complete_module_setup', moduleSlug )
call to thefinishSetup
callback. - Add a new callback for the cancel button that calls
trackEvent( 'moduleSetup', 'cancel_module_setup', moduleSlug )
.
- Add
- In
Test Coverage
- N/A
Visual Regression Changes
- N/A
QA Brief
- Install the Google Analytics Debugger extension for your Google Chrome if you haven’t done it yet.
- Verify that events mentioned in AC are triggered correctly.
Changelog entry
- N/A
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Activation events - Optimize Resource Hub - Google Support
Create your experience (A/B, multivariate, redirect test, or personalization) · Navigate to Settings > Activation event on the experience details page · Click ......
Read more >Site Kit by Google – Analytics, Search Console, AdSense ...
Easy-to-understand stats directly on your WordPress dashboard; Official stats from multiple Google tools, all in one dashboard; Quick setup for multiple ...
Read more >readme.txt - HSDC
Refactor settings tabs with React Router and update URL hashes with more ... Add a module activation CTA for Idea Hub to the...
Read more >Setting up and tracking AutoLeadStar goals and events in ...
AutoLeadStar automatically sends events into Google Analytics. No need to turn anything on, activate or otherwise adjust a setting with this ...
Read more >Track Events with Google Analytics 4 (GA4) and Google Tag ...
Also, keep in mind that this guide focuses mainly on the setup. I will include a chapter with a quick overview of reports...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, let’s look at it in #4006. IB is updated.
QA Update: ✅
Verified that I have been through all of the ACs for Module activation and deactivation, Module setup and Idea Hub activation prompt notification. I can confirm that the events are triggered as per the ACs. The initial issue reported here has been fixed and the dashboard_module-activation-notification event is only triggered at the top large CTA, and not the widget anymore.