Here’s an update to Erik Vasilik’s “Poor Man’s GWO/Analytics Integration” technique. The latest iteration of the technique used GA’s user-defined variable to store the combination the visitor saw. Here’s an update to that technique, but leveraging the new Custom Variables just released by Google.

Multivariate Test Integration

To integrate with an MV test, you need to replace the code

with

You will need to make a few modifications to the code.

  1. Update the first argument to an unused MCV slot. In the sample code, we’ll be storing the GWO information in slot 1.
  2. Update ‘Basic MVT Experiment’ to the name of the experiment being run.

You will need to be very careful as to where you place this script. The function _setCustomVar must be called before the call to _trackPageview. This is because custom vars are sent with the next call to either _trackPageview or _trackEvent. This is in contrast to _setVar, which sends it’s own request when the code is executed.

Here is some sample code for how the order of execution should appear:

 

A/B Test integration

As with the old GA/GWO integration technique, special consideration must be taken for A/B experiments. Because the page redirects to the “B” page before any analytics code is run, we need to insert the custom variable code between the code that defines the “utmx” function, and the code that actually runs the “utmx” function. Using UDVs, this was easily achieved by inserting the call to _setVar between the two pieces of code. But, remember how I mentioned that MCVs are sent along with the next call to _trackPageview or _trackEvent? Well, setting the custom variable, and then sending either a pageview or event will have a really negative effect on your bounce rates. Especially if your A/B experiment is on a landing page!

To track the A/B test correctly, you can implement one of the following solutions:

  1. In the GA tracking code on the A and B pages, populate the custom variable information using information stored in the “__utmx” cookie.
  2. In between the two sets of code, set a cookie containing the experiment information. Then, in the GA tracking code on the A and B pages, read the cookie, set the custom variable, then delete the cookie. I would highly recommend this method because the JavaScript code is simpler to implement

Message Sent

Thank you for registering.

Cardinal Path hosted a live session to connect with you and answer all your questions on Google Analytics.
Get all the expertise and none of the consultancy fees in this not-to-be-missed, rapid-fire virtual event.

Thank you for submitting the form.

Thank you for submitting the form.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Click here to download access the tool.

Message Sent

Thank you for registering.

Message Sent

Thank you.

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Thank you

Message Sent

Thank you.

Message Sent

Success!
Your message was received.

Thank you.

Thank you for registering.

Cardinal Path is continuing with its series of free training. Next we are conducting training on Google Data Studio. Check it out here.

Message Sent

Thank you for registering.

Thank you for your submission.

Your request has been submitted and a rep will reach out to you shortly.

Message Sent

Thank you for your interest.

Thank you for registering.

You should receive a confirmation email from GoToWebinar with your unique webinar login information. If you do not receive this email or have trouble logging in to the event, please email asmaa.mourad@cardinalpath.com.

Thank you for subscribing!

You're now looped into the world's largest GMP resource hub!

Thank you for your submission.

Thank you for your submission.

Thank you for your submission.

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Thank you for your submission.

Thank you for your submission.

Message Sent

Thank you for registering.

Thank you for registering.​

Paid media spend by Government websites increased a whopping 139% YoY in 2020.

2020 Online Behavior Live Dashboard

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

2020 Online Behavior Live Dashboard

Thank you for your submission.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Thank you for registering.

Message Sent

Success! Thank you
for reaching out.