If you already have a GTM container on your template, you can use GTM to create your dataLayer.
Pushing events from your dataLayer to GA4 using GTM
If you already have a GTM container working on your website, you already have a dataLayer created.
đĄ Please familiarise yourself with the events we send to your dataLayer.
đĄ In order to work with GA4 via GTM, please make sure you already have your Google Analytics GA4 Configuration tag set up.
đ Setting up GA4 tags for events in GTM
Get your windows ready! We recommend having the following windows open to make this as easy as possible:
Events we send to your dataLayer
GTM
Product page with the console open
Youâll need to
Create a new tag for every event (example underlined in yellow). This only needs to be done once during setup.
Define the variables under each event (underlined in purple)
Define the custom trigger for each event
Navigate to âNew Tagâ
Label your tag (ex. âSyncle video startâ to describe initialised playback)
Click âTag configurationâ
Select âGoogle Analytics: GA4 Eventâ
Under âConfiguration Tag', select your GA4 configuration tag
Under âEvent nameâ, type the event name
âď¸Ensure youâre using the same syntax as is used for the dataLayer event (see screenshot below)
Click on âEvent Parametersâ. This is where youâll be defining your event variables. Youâll have to define each variable that you want to be pulled through.
Label your parameters (e.g âSyncle Product Titleâ / Syncle Video Title)
Click on the â+â-brick to define the âValueâ field (this will take you to a list of variables to choose from)
Click the â+â in the top right-hand side corner to create a new variable
Click on the brick under âVariable Configurationâ
Select âDataLayer Variableâ
Enter the name of the variable (underlined in purple). ! Ensure youâre using the same syntax as is used for the dataLayer event!
Label your variable
Click âSaveâ
Navigate to âTriggerâ
Click the grey circle to configure your trigger
Click the â+â in the top right-hand side corner to configure your custom trigger
We want to set up a custom trigger for when the event is created in the dataLayer to be sent to your GA
Click on âCustom eventâ
Label your custom event (e.g. âSyncle.videoStartâ)
Label your custom trigger on the top left-hand side corner (e.g. Syncle.videoStart)
Click âsaveâ
Summary
Go to GTM and click on âTagsâ.
đĄ The first step is to create a new tag and configure it. You must configure EVERYTHING you want to come through the dataLayer, as this will not happen automatically.
Get your GA4 configuration tag set up and know the name of the specific event you would like to pull through to GA4 (ex.: ââI want to know if the widget shows videos, or notââ).
Event Name: the name of the specific event you want to pull (e.g. called Videoly.initialize in the data layer).
Parameter Name: What you want to be the name of the variables when pulled through to GA4.
Value: The value of the variable inside of the event(e.g. product name - called product in the data layer).
đCreating a custom data layer variable
Custom trigger: All Custom Events just means that every time there is a custom event with the name Videoly.initialize then this event will be sent to GA4, with the variables associated.
You can check in âTag Assistantâ that everything went as expected: It looks like the event name and the expected values were sent as intended.
Youâll see the even in in GA4 debug view.
âď¸NOTE: This process needs to be repeated for every event and variable you want to push to GA4.