Refactor GA tracking events for module settings
See original GitHub issueThis issue introduces new general GA events around module settings (related: #4004).
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). - The following new GA events should be fired in the Settings > Connected services tab, for all modules (event category:
settings_module-list
, event label: the respective module slug):view_module_settings
whenever the user expands a module’s settings panel.close_module_settings
whenever the user collapses a module’s settings panel.edit_module_settings
whenever the user clicks on the “Edit” button within a module’s settings panel.update_module_settings
whenever a module’s settings have been successfully updated (via thehandleConfirm
callback within the module’s settings panel’sFooter
).cancel_module_settings
whenever the user cancels out of the “Edit” mode explicitly via the “Cancel” (or “Close”) button within the module settings panel’sFooter
.
Implementation Brief
- In
assets/js/components/settings/SettingsActiveModule/Header.js
:- Add a new callback that calls
trackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'view_module_settings', slug )
ifisOpen
is false. Otherwise it should calltrackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'close_module_settings', slug )
. - Add the new callback to the
onClick
property of theLink
element.
- Add a new callback that calls
- In
assets/js/components/settings/SettingsActiveModule/Footer.js
:- Add a new callback
handleEdit
that callstrackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'edit_module_settings', slug )
. - Add the
handleEdit
callback to theonClick
property of the Edit link. - Update the
handleConfirm
callback to calltrackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'update_module_settings', slug )
when settigns are saved successfully. - Update the
handleClose
callback to calltrackEvent( '${ VIEW_CONTEXT_SETTINGS }_module-list', 'cancel_module_settings', slug )
.
- Add a new callback
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:7 (3 by maintainers)
Top Results From Across the Web
Refactor GA tracking events for module activation and setup ...
As part of redefining some of our legacy GA tracking events, this issue focuses on module activation and setup. As part of that...
Read more >[GA4] Modify and create events via the user interface
This article describes how to modify and create events in Analytics configuration. All events created in Analytics are based on existing website and...
Read more >Google Tag Manager Form Tracking with GA4 - Analytics Mania
Go to Tags; Press New button; In Tag Configuration choose Google Analytics: GA4 Event; In the Configuration Tag field, select your current ...
Read more >Refactor module architecture in a simpler, opinionated and ...
#3002332: Track composite (e.g. paragraph) entities directly and only as their ... All events dispatched by this module have been adjusted, ...
Read more >Using Google Analytics Event Tracking - Hallam Internet
Create a new tag in Google Tag Manager and change the Track Type to 'Event'. The configuration options will now include tracking parameter ......
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
@wpdarren The
cancel_module_settings
should indeed happen on either the “Close” or “Cancel” button (which technically do almost the same thing, it’s just that the label is different for modules where there are no settings. So it looks like that indeed needs to be fixed @kuasha420This is correct as is. All the
*_module_settings
events are to compare interactions in the UI, whereas thedeactivate_module
event is more focused on seeing from where and how often people deactivate modules.QA Update: ✅
Verified:
settings_module-list
, event label appears on all:view_module_settings
whenever the user expands a module’s settings panel.close_module_settings
whenever the user collapses a module’s settings panel.edit_module_settings
whenever the user clicks on the “Edit” button within a module’s settings panel.update_module_settings
whenever a module’s settings have been successfully updatedcancel_module_settings
whenever the user cancels out of the “Cancel” and “Close” button.