Use Google Tag Manager to Measure Everything as Custom Event Goals
- 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-test
Code and GTM container templates included.
This is really interesting and real kudos to you for putting this together! Really great example of how we can leverage the datalayer.
Technical Support Representative
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.
@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.
@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
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! : )