Skip to content

Commit

Permalink
Merge pull request #2655 from alphagov/start-button-ab-test-july-2016
Browse files Browse the repository at this point in the history
Start button AB test  For July 2016
  • Loading branch information
ikennaokpala authored Jul 28, 2016
2 parents 47d23cf + e471dae commit 8005e31
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gem 'ast'
gem 'gds-api-adapters', '~> 30.6'
gem 'govspeak', '~> 3.3.0'
gem 'govuk-content-schema-test-helpers', '~> 1.3.0'
gem 'govuk_frontend_toolkit', '4.8.0'
gem 'govuk_frontend_toolkit', '4.14.0'
gem 'htmlentities', '~> 4'
gem 'json'
gem 'logstasher', '0.4.8'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ GEM
govuk-lint (0.7.0)
rubocop (~> 0.35.0)
scss_lint (~> 0.44.0)
govuk_frontend_toolkit (4.8.0)
govuk_frontend_toolkit (4.14.0)
rails (>= 3.1.0)
sass (>= 3.2.0)
htmlentities (4.3.3)
Expand Down Expand Up @@ -268,7 +268,7 @@ DEPENDENCIES
govspeak (~> 3.3.0)
govuk-content-schema-test-helpers (~> 1.3.0)
govuk-lint
govuk_frontend_toolkit (= 4.8.0)
govuk_frontend_toolkit (= 4.14.0)
htmlentities (~> 4)
json
logstasher (= 0.4.8)
Expand Down
7 changes: 7 additions & 0 deletions app/assets/javascripts/smart-answers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//= require start-button-ab-test-july-2016

var SmartAnswer = SmartAnswer || {};
SmartAnswer.isStartPage = function(slug) { // Used mostly during A/B testing
return window.location.pathname.split("/").join("") == slug;
}

function browserSupportsHtml5HistoryApi() {
return !! (history && history.replaceState && history.pushState);
}
Expand Down
48 changes: 48 additions & 0 deletions app/assets/javascripts/start-button-ab-test-july-2016.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//= require govuk/multivariate-test

$(function(){
if(SmartAnswer.isStartPage("overseas-passports")) {
new GOVUK.MultivariateTest({
el: '.get-started a',
name: 'startButton_osPassport_201607',
customDimensionIndex: [13, 14],
cookieDuration: 2, // set cookie expiry to 2 days
contentExperimentId: 'cZbCgQy3SOCHEX2l6bU-eQ',
cohorts: {
original: { callback: function() {}, variantId: 0},
next: { html: 'Next', variantId: 1 },
continue: { html: 'Continue', variantId: 2 }
}
});
}

if(SmartAnswer.isStartPage("calculate-your-child-maintenance")) {
new GOVUK.MultivariateTest({
el: '.get-started a',
name: 'startButton_calcChildM_201607',
customDimensionIndex: [13, 14],
cookieDuration: 2, // set cookie expiry to 2 days
contentExperimentId: '02HyTKtNR-yHsYlI6JoJqg',
cohorts: {
original: { callback: function() {}, variantId: 0},
next: { html: 'Next', variantId: 1 },
continue: { html: 'Continue', variantId: 2 }
}
});
}

if(SmartAnswer.isStartPage("marriage-abroad")) {
new GOVUK.MultivariateTest({
el: '.get-started a',
name: 'startButton_marriageAbroad_201607',
customDimensionIndex: [13, 14],
cookieDuration: 2, // set cookie expiry to 2 days
contentExperimentId: 'ABoraDMOQCC9WjJWsTpIPg',
cohorts: {
original: { callback: function() {}, variantId: 0},
next: { html: 'Next', variantId: 1 },
continue: { html: 'Continue', variantId: 2 }
}
});
}
});

0 comments on commit 8005e31

Please sign in to comment.