Tom Fuertes

home

Optimizely & Universal Analytics via GTM

01 Jul 2014

xpost from clearhead.me

If you've done any sort of custom configuration to your Universal Analytics Tag in Google Tag Manager, @nicholasblexrud's pattern in "Add Optimizely with Universal Analytics via Tag Manager" will leave you - like a ball kicked to Tim Howard - blocked.

Not to fear! Clearhead's office is streaming the world cup, so we've turned off the billable clock and are writing blog posts in between the action. Should be just time enough to photoblog our Optimizely GTM Integration process…

One Time: GA and GTM Setup

First, we create a series of Custom Dimensions so we can gather data on up to 5 concurrent tests:

Optimizely and Google Tag Manager Dimensions.png

Next, we create Google Tag Manager macros to look for clearhead.ab1 through clearhead.ab5 variables:

Optimizely and Google Tag Manager Config.png

Optimizely and Google Tag Manager Macro.png

Yay! We're all setup.

Every Time: Experiment's Global JS Now it's just a matter of currying the user's metadata into the global variables via the experiment's global js (image links to gist).

Optimizely and Google Tag Manager Snippet.png

That sweet, sweet, data.

Optimizely and Google Tag Manager Data.png

Obviously lots of moving parts here! If you're a dev or analyst reading this, we're hiring and/or hire-able as help!

-Tom