A/B testing is such important practice that enduro support it out of the box and setting it up could not be any easier.
Let’s say we have a page in the root folder named contact.hbs
. To create an A/B test variant just duplicate this file and add @tag
at the end of it’s name. Another file’s name could for example be contact@bigbutton.hbs
.
The two files: contact.hbs
and contact@bigbutton.hbs
will be served with a 50% chance. You can create as many variants as you want and they will always be served in equal ratio.
You’ll have to use third-party tools to analyze which variant is more successful.
You can pass page visit as an event and pass a goal event as another event. See this example:
ga('send', 'event', 'contacttest', 'visit', 'smallbutton')
$('button.learn-more').click(function () {
ga('send', 'event', 'contacttest', 'goal', 'smallbutton')
})
This code will register event under name contacttest
and uses eventValue attribute to differentiate between A/B variants.
For user interface consistency, users that received variant A will also receive variant A on any subsequent reloads. This is guaranteed by a cookie.