Skip to main content

Pushing events from your dataLayer to your GA property

I
Written by Inka Turunen
Updated over a month ago

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.

Did this answer your question?