Data Layer

Variable from site can be sent to GTM through Data Layer. There are two method to work with dataLayer

Static Initialization in <head> tag (or previous GTM container’s call) – View Source of this page:


After page loaded (or after GTM container called):

Try to click this link




dataLayer is a javascript array and it can store one or more multiple object…makes it a complex Array, for example:

dataLayer=[ {



















Read more:

Trigger and Event Tracking

Hello, this page get tracked for a multiple purpose, including:
1. Tracking on Button (Event Tracking)

2. Event Tracking on Outgoing Link



Internal Link Sample

3. Event Tracking on Download Link

Download Digital Metrics Playbook

Download Social Media Strategy by Hootsuite

This is a Test TXT File 

4. Youtube Tracking


Script for youtube checker

Script for listener


  1. Create Custom Variable for checker (yt_checker)
  2. Create Trigger with “DOM Ready” and filter where yt_checker set to true i named it “yt_checktrigger”
  3. Create new Custom HTML tag, use listener scipt above and use “yt_checktrigger” as Trigger
  4. The listener script send 4 parameter:
    1. eventName: ‘youtube’
    2. eventCategory: ‘Youtube Videos’
    3. eventAction: <<theVideo Title>>
    4. eventLabel: <<theVideo event info / length>>

      You need to create DataLaer Variable for eventCategory, eventAction, and eventLabel

  5. Create new trigger, its a Custom Event, and use event name ‘youtube’. i named this trigger ‘YT_Action’
  6. Create new tag, set to Analytics Event, then assign Category, Action, Label as parameter on step 4. Use ‘custom event’ as trigger and set to ‘YT_Action’
  7. Preview and Publish