0
Answered

How can we use GTM to track analytics?

Anonymous 9 years ago updated by Chad Williams 9 years ago 1

Is it possible to use Google Tag Manager to track the analytics?

Answer

Answer
Answered

Yes, it is possible to use Google Tag Manager for managing all your SimplePath code on your website. Here are the steps for tracking analytics:


1.) Create Data Layer variables for Event Action, Event Category, Event Label. To do this, for each of those, go to "Variables", click "New", choose Data Layer Variable, give it the name and click "Create Variable". (Leave other options as default)

2.) Create a Static variable for GoogleAnalyticsID . To do this, go to variables, click new, choose type "Static", and enter your GA id, should start with "UA-".

3.) Create a trigger for SimplePath Event. To do this, go to Triggers, click new, type is "Custom", Fire On is "SimplePath"

4.) Create a SimplePath Tag. To do this:

  • Go to Tags
  • click New
  • product is Google Analytics
  • choose Universal Analytics
  • click Advanced Settings.
  • Tracking ID is {{GoogleAnalyticsID}}
  • Track Type is Event
  • Category is {{ Event Category }}
  • action is {{ Event Action }}
  • label is {{ Event Label }}
  • Leave other options as defaults
  • Click continue
  • fire on is More -> SimplePath Event

Some extra information:
Basically what we're doing is creating a tag that gets fired on a custom event sent from simplepath. The event in the code is sending the label, action, and category, so we're injecting those into the tag event that is connected to google analytics through the product and analytics ID. Tags in Google Tag Manager are more than just snippets, they can also be events that you send on to other products, and can also be fired from things like Page Load, clicking on elements, etc. Anywhere you use {{ ... }} it uses that variable's value instead of a text value. You could actually skip the step of creating GoogleAnalyticsID and paste your ID directly into the Tag, but it's good practice to have that variable to use for multiple tags.

If you need help on any step, let us know!

Answer
Answered

Yes, it is possible to use Google Tag Manager for managing all your SimplePath code on your website. Here are the steps for tracking analytics:


1.) Create Data Layer variables for Event Action, Event Category, Event Label. To do this, for each of those, go to "Variables", click "New", choose Data Layer Variable, give it the name and click "Create Variable". (Leave other options as default)

2.) Create a Static variable for GoogleAnalyticsID . To do this, go to variables, click new, choose type "Static", and enter your GA id, should start with "UA-".

3.) Create a trigger for SimplePath Event. To do this, go to Triggers, click new, type is "Custom", Fire On is "SimplePath"

4.) Create a SimplePath Tag. To do this:

  • Go to Tags
  • click New
  • product is Google Analytics
  • choose Universal Analytics
  • click Advanced Settings.
  • Tracking ID is {{GoogleAnalyticsID}}
  • Track Type is Event
  • Category is {{ Event Category }}
  • action is {{ Event Action }}
  • label is {{ Event Label }}
  • Leave other options as defaults
  • Click continue
  • fire on is More -> SimplePath Event

Some extra information:
Basically what we're doing is creating a tag that gets fired on a custom event sent from simplepath. The event in the code is sending the label, action, and category, so we're injecting those into the tag event that is connected to google analytics through the product and analytics ID. Tags in Google Tag Manager are more than just snippets, they can also be events that you send on to other products, and can also be fired from things like Page Load, clicking on elements, etc. Anywhere you use {{ ... }} it uses that variable's value instead of a text value. You could actually skip the step of creating GoogleAnalyticsID and paste your ID directly into the Tag, but it's good practice to have that variable to use for multiple tags.

If you need help on any step, let us know!