-
Epic
-
Resolution: Fixed
-
Must have
-
None
-
None
-
Implement new standard events on clicks
-
Analytics
Context:
Last year we started implementing a few click events on Planet 4 elements for design iteration and testing. We selected a few websites and implemented the click events via Google Tag Manager, most often based on elements IDs or classes.
We now need to implement these events on all Planet 4 websites. We should use a different methodology to be more accurate on the tracking and make the implementation easier (on all P4-NRO’s Google Tag Manager containers).
Solution:
We should implement dataLayer events on the elements/blocks that are already partially tracked (Navigation, Call to Actions, Columns Blocks) and on those required by the Design Team (Search Page).
Tracking Methodology (updated April 29)
As suggested by pvincent and sdeshmuk, we can work with data-* attributes instead of dataLayer events. This should facilitate the implementation while also allowing some more flexibility when setting up the events tags in Google Tag Manager.
The idea is to implement a set of new data attributes with standard values. These will be used later to trigger events and define its category, action and label.
- Example: See image attached for using GTM's dataLayer variable to extract data attributes (gtm.element.dataset.target)**
- Useful Links: https://mixedanalytics.com/blog/value-data-attributes-javascript-gtm/
Epic Steps:
- Review existing event standards and find the best implementation methodology: --
--PLANET-4961 - Create development tasks for implementing dataLayer on the different elements/blocks:
PLANET-4962 - Implement the new changes on “P4 - GPI” Google Tag Manager container as a pilot
- Update Global Property documentation and the standards used
- Implement changes on all P4-NRO’s Google Tag Manager containers (create a new workspace and ask NRO’s to review/publish).
- Create an internal dashboard to monitor the event’s standards