Set up Google Tag Manager for reporting in Google Analytics

Adding the right variables, triggers and tags to Google Tag Manager

Christiaan Proper avatar
Written by Christiaan Proper
Updated over a week ago

When Google Analytics is connected to Datatrics and all Custom Dimensions are set up, and there is an active Google Tag Manager container on your website. There are a few thing you need to add to your Google Tag Manager container.

“Custom Dimensions? What are those?” → Read this article first

Datatrics sends events and custom dimensions to Google Analytics, which need to be defined in Google Tag Manager. First, you need to add variables to your container.

Navigate to the Variables section in Google Tag Manager and create the following User-Defined Variables:

  • event

  •      Type: Custom Event

  • eventAction

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: eventAction

  • eventCategory

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: eventCategory

  • eventLabel

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: eventLabel

  • Datatrics Group

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: dtgroup

  • Datatrics Journey

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: journeyid

  • Datatrics Buying Phase

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: buyingphase

  • Datatrics Campaign

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: campaignid

  • Datatrics Persuasion

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: persuasion

  • Datatrics Customer Type

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: customertype

  • Datatrics Touchpoint

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: touchpoint

  • Datatrics Touchpoint Content

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: content

  • Datatrics Segment

  •      Type: Data Layer Variable

  •      Data Layer Variable Name: segmentid

Next up is a trigger, so head over to the Triggers section in Google Tag Manager and add the following trigger:

  • Trigger DatatricsEvent

  •      Trigger type: Custom Event

  •      Event name: DatatricsEvent

  •      Fires on: All Custom Events

The last thing you need to add is a tag which sends the variables to Google Analytics, when the trigger DatatricsEvent is fired. Navigate to the Tags section and add this tag:

  • Universal Analytics - Datatrics

  •      Tag type: Universal Analytics

  •      Track Type: Event

  •      Category: {{eventCategory}} (This is a variable we just added)

  •      Action: {{eventAction}} (This is a variable we just added)

  •      Label: {{eventLabel}} (This is a variable we just added)

  •      Non-Interaction Hit: True (Don’t forget to change this one)

  •      Check the “Enable overriding settings in this tag” option

  •      Tracking ID: Your Tracking ID, the chance is big you already have this saved as a constant

  •      More Settings > Custom Dimensions: Add all nine Datatrics Custom Dimensions which are added to your Google Analytics property. Make sure you enter the correct indexes and the associated Dimension Values. The following image illustrates which indexes to enter (this is an example, it doesn't include all custom dimensions):

  • Firing trigger: the trigger DatatricsEvent we added above.

When all the information above is entered, the tag should look like this ( (This screenshot doesn't include the "Datatrics Segment" custom dimension, don't forget to add it):

When the changes are published, all Datatrics events and dimensions will be send to Google Analytics through Google Tag Manager.

Are you using Enhanced Ecommerce through Google Tag Manager? Click here!

Did this answer your question?