-
Notifications
You must be signed in to change notification settings - Fork 5
ab testing
For information about A/B testing with Optimizely, go this section.
- Set a canonical url reference in html
It’s a good idea to still indicate the actual url of the alternative page refers to the original one. To achieve this, we should add the following to the layout, in the
section.file: /application/modules/default/views/layouts/layout.phtml
<?php if(isset($this->canonicalUrl)): ?>
<link rel="canonical" href="<?php
echo $this->baseUrl($this->canonicalUrl);
?>"></link>
<?php endif; ?>
We’re using the canonicalUrl variable here, that we’ve just added in the controller action.
As practiced in the Melkweg site.
- Make sure GTM is called, and Google Analytics by GTM (see also Angularytics for a decent Google Analytics implementation in Angular)
- Grab our own
googleAbTesting
Angular module off Github: https://github.com/grrr-amsterdam/angular-google-abtesting - Configure the provider with the Google Content Experiments ID
- Create an element for each variation, add variation directive to it:
<h1 variation="0">Welcome to my personal homepage</h1>
<h1 variation="1">I created a homepage and you're not going to believe what happened next!!</h1>
<h1 variation="2">Free iPod!</h1>
See Google's own documentation here: https://developers.google.com/analytics/solutions/experiments-client-side
Basically it comes down to:
- Load Google cxApi with your experiment id in the query string
- Ask the API for the variation
- Do something with this variation (hide/show content, etc.)
- Create variation view with ?v=b (either in view or controller)
- Embed Google Content Experiments code on original + variation page
- The embed will now redirect some users to the variation page
- Set up a new experiment under Behavior / Experiments.
- Configure the first url: insert an example of a url of this type. This url is not the only one the experiment will be ran on, instead all the pages that include the Google Experiments Code will be included in the experiment.
- Configure the second url: choose 'relative' as type, and use '?v=b' as value.
- Ignore all warnings about non-existing codes to be embedded (these warnings give really unreliable feedback) and start the experiment.
Also see: http://support.google.com/analytics/bin/answer.py?hl=en&answer=1745216
Optimizely is a easy to use testing tool for websites and the support will answer a lot of questions. But her some things I encountered.
There is a code snippet that you need to include high in the
of your website. It needs to load synchronously so don't load it with google tag manager.If you’re an existing Google Tag Manager user, you may already have pre-configured Universal Analytics tags that fire off pageview calls. If this is the case, check this out
If your site is not using https then you will see an No 'Access-Control-Allow-Origin' header is present error in your console. Don't worry about this, optimizely will work anyway. Or [read this ticket that explains this issue] (https://community.optimizely.com/t5/Using-Optimizely/XMLHttpRequest-cannot-load-app-optimizely/td-p/11639).