1

I've started rolling out new features to a site using Netlify's branch split testing so I can say ex. 10% of users gets a branch with a specific UI change to see if it produces measurably different results. I have google analytics events set up to track some useful metrics already.

How can I compare the events in branch A with branch B in google analytics? I think there are two parts here: how to change the analytics code to identify sessions on branch A vs branch B, and also where to create a view in google analytics that I can compare events from sessions in A to sessions in B.

I'm happy with the tools I'm using so I'd like to avoid cluttering my page with yet another tracking script from a single-purpose A/B test provider when I'm pretty sure my existing tools can do this, I just don't know how.

1

Google Analytics has built in support for multivariate A/B testing. The first is available within GA under "Behavior" -> "Experiments." The second way to do this is via Google Optimize.

I'm not sure how these would work with the A/B testing solution you are already using but it will provide a great way to compare analytic performance between the different versions.

  • Thanks for the help. Optimize seems like an interesting and easy to use tool for testing text changes and other cosmetic edits on a page - netlify A/B gets a bit more powerful since I can deploy code base changes. – Nick Dec 20 '18 at 17:24
1

After a bit more experimentation, I figured out what I was looking for:

Netlify adds an environmental variable BRANCH that tells you what portion of the A/B test you're on. I created a new dimension in google analytics and used my analytics tags to set dimension4: process.env.BRANCH.

To compare against normal traffic in google analytics, I created a fresh segment that was based off my new dimension, matching the branch name exactly. Now I can compare traffic or events on any screen that can compare between segments.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.