Rich-text Reply

Use Google Tag Manager to Measure Everything as Custom Event Goals

tFox 11-10-14

Use Google Tag Manager to Measure Everything as Custom Event Goals

[ Edited ]

Hello Optiverse,

 

I put together a post on how to use Google Tag Manager (GTM) and the Optimizely Javascript API to track everything with Custom Event Goals. Example include:

 

  • YouTube Video Event Tracking
  • Form Submit Tracking (optional validation)
  • Scroll Depth Tracking
  • Pretty much everything else

Check it out here: http://trevorfox.com/2014/11/scale-optimizely-testing-google-tag-manager

 

Code and GTM container templates included.

 

thanks @AmandaS 

Level 2

Amara 11-10-14
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

tFox,

 

This is really interesting and real kudos to you for putting this together! Really great example of how we can leverage the datalayer. 

 

Best,

Teja

-----
Teja Shah
Technical Support Representative
Optimizely
greg 11-11-14
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

Nice write-up! I'll be experimenting with this soon.
Level 2
greg 11-11-14
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

[ Edited ]

This gave me another idea: Using GTM to manually activate experiments after page load based on (almost) any condition.

- Set experiment to manual activation.
- Create tag to manually activate that experiment.
- Create custom macro with condition logic (if needed).
- Create rule to evaluate the macro/condition.
- Fire the manual activation tag if condition is met.

 

The workaround as suggested by Optimizely results in burning through your monthly users limit because you have a separate "dummy" experiment just to determine whether to activate the real experiment.

Level 2
tFox 11-11-14
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

[ Edited ]

Great idea  @greg ! GTM is a layer of logic on top of your application that is designed for triggering and routing. This is probably an even more valuable use. Thanks for taking this one step farther!

Level 2

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

Hey @greg, I had the same thought. Did you give GTM experiment activation a try and if so, how does it work?
Growth & optimization pro focused on SaaS
greg 03-13-16
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

@mikefiorillo Oh man I have to think back pretty far on this. I don't think I ever needed to use the method I described above, mostly because I had access to build the logic on the backend of the site(s). But I'm pretty confident my described solution would work.

Level 2
swiftCRO 03-14-16
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

@greg no doubt it would work either, i'm more wondering about any latency that might cause content flickering vs. hard coding the activation call right into the app itself... guess it's trial and error time Smiley Happy

Level 1
tFox 03-14-16
 

Re: Use Google Tag Manager to Measure Everything as Custom Event Goals

[ Edited ]

@swiftCRO

For my two cents, I would suggest keeping the logic within the app. Any logic that is handled by GTM will be triggered, only after GTM itself is loaded. I've played around with loading a feedback widget via GTM and it was a wreck compared to loading it on pageload. That's probably more of an extreme case for this, but you get the idea.

I'd bet that the risk of exposing your user to a delay/flashing does not justify the amount of time/work you will save in handling the logic with GTM.

Although the thought of running experiments based on conditions introduced within GTM is clever, I would suggest that that any experiment that depends on these conditions be able to fully materialize outside the awareness of the user. The original intent of this was to make data collection easier and hopefully more consistent.

All that being said, TRIAL IT! : )

Level 2