Running Optimizely, Google Tag Manager and Universal Analytics

You’ve heard it a few times before. You’ve been told that A/B testing is the sh-t. Main question now is, how do you get started and what are the tools you could / should use? My ambition here is to provide an “as platform-agnostic solution as possible”.

Ok, but where do I start?

It all depends on your “A/B test maturity level” of course. During this post I’m going to assume a business understanding of why and what to test.

If you’re not absolutely certain if you’ve got that covered I’d start out by creating a test hypothesis (Hypothesis creator by Conversionista) for everything that you’ve identified and then setting priorities.

Getting your business priorities in order is key!

Setting it all up

Here comes the second the assumption of the post. You need to be familiar with Google Tag Manager and Google Universal Analytics. You don’t have to be an expert, but at least find your way around the tools.

If you haven’t already, create accounts for Tag Manager, Universal Analytics and Optimizely. If you need help setting up Tag Manager, please go through the “Setup and Workflow (Web)” instructions over at And if you need help setting up Universal Analytics, please visit “Set up Universal Analytics: An overview” at

Setting up Optimizely is fairly straight forward and the actual implementation will be covered during this article.

Let’s get started, for real!

We’ll start out with Optimizely, where you’ll set up the actual A/B tests. After you’ve created you Optimizely account, go to the homepage and click settings. There you’ll find the code snippet in the box below the project ID.

<script src="//"></script>

As we’re doing this “The Tag Manager”-way you now need to head over to Tag Manager, create a new Custom HTML tag and paste the Optimizely snippet into the HTML field, click Continue and check All Pages, and the publish your changes. First hurdle passed, well done.

Tag Manager and Optimizely snippet

If you use my suggested setup with Tag Manager, Universal Analytics and Optimizely you won’t be able to use the built-in Analytics tag type in Tag Manager. You’ll have to create another Custom HTML tag. But you’ve mastered that already! This time head over to you Analytics account, get the tracking code snippet, and use that in the HTML field in your new Custom HTML tag in Tag Manager.

Now you need to add the Optimizely activation part. In your newly created Tag Manager Custom HTML tag add the following two rows of code just before the ga send row.

window.optimizely = window.optimizely || [];

Now you’ve all set up to start creating Optimizely experiments on your website. Neat eh? All you need to do now is to create your first A/B test. Head over to Optimizely, click New Experiment, give your new experiment a name and a URL (aka where on your site do you wanna run your test?).

All you need to do now is to create the different test variations that you want to run. If you’re not a high-traffic website I’d keep the tests rather small in terms of number of variations. You’ll need traffic in order to determine a winner.

Other settings that might be of interest is traffic allocation, goals and audience.

Optimizely experiment settings

Bonus time!

And lastly I’ve added a bonus feature. Since you’re using Optimizely and Universal Analytics now, you really should feed your Analytics account with the highly valuable Optimizely data. And this is quite straight forward.

In your Optimizely experiment you choose a Google Analytics integration and then you choose a Custom Dimension id that you’re not already using, there are 20 available. Unless you’ve tinkered with the custom tracker part, just leave it empty.

Now head over to your Analytics account, admin, property, custom definitions and then custom dimensions. Now create a new custom dimension, name it “Optimizely Experiments”, choose session and save. The index number has to be the same as the number you entered in Optimizely.

Last step is to create a custom report that shows you the test results. Add whatever metrics you want together with your new dimension. And then add your shiny new custom dimension under Dimension Drilldowns. After that you add a regex filter that only includes traffic with your Optimizely experiment ID.

Time to sum it up

Ok, now it’s time to sum it all up. You should now have a fully functional A/B test setup using Google Tag Manager, Google Universal Analytics and Optimizely. All neatly integrated. Leave a comment below if there’s something in the process above that was tricky or right out misleading.

And lastly, good luck with the A/B testing!

Passing the Google Analytics Individual Qualification exam

Since you’re reading this blog post, I’m 100% sure that you’re aware of what the Google Analytics Individual Qualification is and what the benefits are. Therefore I won’t waste your time explaining that.

There are tons of blogs about passing the GAIQ exam, and I’ve browsed through most of them. They all tell you a similar story. And here’s my take on the matter.

Focus Daniel-san!

If I had to choose one tip to rule them all, that tip would definitely be study. And don’t underestimate the time it takes. Watching Cutroni’s videos over at Google Analytics Academy is worth every minute. And the course assessments are gold!

When you’re done watching the videos, watch them once more. As I said, they’re gold. And if you’ve watched the videos but want more training resources I have a few good ones that I gathered while researching prior to my own exam.

Blast Media has a great Google Analytics cheat sheet covering the basics in an easy-to-understand format. Unless you’re a campaign query and regular expressions ninja, you’ll need a URL campaign builder and some sort of a regular expression tool. And lastly the Google Analytics help centre is quite, errr, quite helpful.

Right, now what?

Once you’ve done your homework and feel confident that you have what it takes, head over to Google Partners and get registered. When you have your profile set up, you’ll find the Analytics exam under the Certifications section in the main menu.

Be careful though, because as soon as you start the test you won’t be able to mark a question and/or to go back and check your answer.

The actual test takes about 70-90 minutes, depending on how well you’ve prepared. And I’ve read somewhere that if you fail, you’ll face a 7 day waiting period before you can take it again.

And when you finally pass, you’ll get a pretty Analytics certificate that you can print and put on your wall-of-achievements.

Ok, come again?

Here’s how I’d sum it all up in a few nice bullets.

That’s it, folks. Good luck with your Analytics exam journey!

Take 53 – Here I go again

I’ve blogged before. Wouldn’t call the previous attempts successful, but you live and learn right?

This time I’ve got a theme that I’ll try to stick to. I’ll share insights and personal experience when it comes to everything surrounding website traffic. Whether it’s having a proper look at your Google Analytics account, making sure everything’s being passed along as it should or getting ready to A/B-test based on proper hypothesis.

I’ll also document my journey through tools such as Google Tag Manager, Universal Analytics and Optimizely. And of course how I tie them all together.

I’ve made mistakes, so why should you make the same ones?

First in line post-wise is a simple one on how I passed the Google Analytics Individual Qualification exam. With a 90% score well within the 90 minute limit.