Skip to content

Commit 5fb9786

Browse files
h-lameboffbowsh
authored andcommitted
Send cohort name to GA
This pulls in a fix from govuk_frontend_toolkit that lives in 4.8.0 (see: alphagov/govuk_frontend_toolkit#251) but frontend currently uses 4.1.0. We don't feel comfortable bumping the dependency so we instead inline the method to get the fix.
1 parent 07e6f9a commit 5fb9786

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/assets/javascripts/register-to-vote.js

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ $(function(){
1515
return cohort;
1616
};
1717

18+
GOVUK.MultivariateTest.prototype.setCustomVar = function(cohort) {
19+
if (this.customDimensionIndex) {
20+
GOVUK.analytics.setDimension(
21+
this.customDimensionIndex,
22+
this.cookieName() + "__" + cohort
23+
);
24+
}
25+
};
26+
1827
var bContent = $('#get-started-b-content').html();
1928

2029
new GOVUK.MultivariateTest({

0 commit comments

Comments
 (0)