Skip to content

Commit 3b29de0

Browse files
committed
Setup abc tests for 3 smart-answers
We want to run abc tests for three smart-answers on the text in the "Start Now" button. We're using both content experiments (configured the contentExperimentId for the test and variantIds for each cohort) and a custom dimension to track the data as this gives us total flexibility for tracking things.
1 parent fbba306 commit 3b29de0

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

app/assets/javascripts/smart-answers.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//= require start-now-button-abc-tests
2+
13
function browserSupportsHtml5HistoryApi() {
24
return !! (history && history.replaceState && history.pushState);
35
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//= require govuk/multivariate-test
2+
3+
$(function(){
4+
if(window.location.href.indexOf("/overseas-passports") > -1) {
5+
new GOVUK.MultivariateTest({
6+
el: '.get-started a',
7+
name: 'startButton_osPassport_201602',
8+
customDimensionIndex: 13,
9+
contentExperimentId: 'egf8SiUzQJmsUuEIbxkCRw',
10+
cohorts: {
11+
original: { callback: function() {}, variantId: 0 },
12+
getApplicationInfo: { html: 'Get application information', variantId: 1 },
13+
next: { html: 'Next', variantId: 2 }
14+
}
15+
});
16+
}
17+
18+
if(window.location.href.indexOf("/calculate-your-child-maintenance") > -1) {
19+
new GOVUK.MultivariateTest({
20+
el: '.get-started a',
21+
name: 'startButton_calcChildM_201602',
22+
customDimensionIndex: 13,
23+
contentExperimentId: 'u0MzUmYRRzmb5mchoGp9Fw',
24+
cohorts: {
25+
original: { callback: function() {}, variantId: 0 },
26+
calculate: { html: 'Calculate', variantId: 1 },
27+
estimateChildMaintenance: { html: 'Estimate your child maintenance', variantId: 2 }
28+
}
29+
});
30+
}
31+
32+
if(window.location.href.indexOf("/marriage-abroad") > -1) {
33+
new GOVUK.MultivariateTest({
34+
el: '.get-started a',
35+
name: 'startButton_marriageAbroad_201602',
36+
customDimensionIndex: 13,
37+
contentExperimentId: 'Xk_FTKgiTwikoIH0fzPklw',
38+
cohorts: {
39+
original: { callback: function() {}, variantId: 0 },
40+
findOutHow: { html: 'Find out how', variantId: 1 },
41+
getMoreInfo: { html: 'Get more information', variantId: 2 }
42+
}
43+
});
44+
}
45+
});

0 commit comments

Comments
 (0)