-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add block of Google Analytics dimensions for A/B tests #890
Conversation
dimension = parseInt($meta.data('analytics-dimension')), | ||
testNameAndBucket = $meta.attr('content'); | ||
|
||
if (dimension >= minAbTestDimension && dimension <= maxAbTestDimension) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK to silently ignore invalid or out-of-range dimensions? I'd prefer to throw an error here to alert the developer to the bad configuration, but I don't want people to accidentally break all analytics and not notice.
3b60036
to
79d76d6
Compare
Closing this temporarily to focus on the education A/B testing. We'll revisit after that's live. Trello: https://trello.com/c/QoJsEjgw/381-better-a-b-testing |
@tijmenb - I'd like to reopen this because we need to add another dimension for the Education Navigation A/B test, and I think this change is the easiest way to do that. Is that OK with you? The alternative would be to give the Example and EducationNavigation |
I've changed the required status checks for this repo. You'll need to rebase this branch against master so that this branch gets a Jenkinsfile can be built against new CI. |
79d76d6
to
f671797
Compare
The GA dimensions from 40-49 have been allocated to A/B tests. These may be reserved for any A/B test for the duration of the test. This commit identifies which dimension to use for the A/B test based on an extra `data` attribute added to the `meta` tag. Only dimensions in the allowed range are permitted. Any others are ignored and are not reported to GA.
f671797
to
dfce693
Compare
The GA dimensions from 40-49 have been allocated to A/B tests. These may be reserved for any A/B test for the duration of the test.
This commit identifies which dimension to use for the A/B test based on an extra
data
attribute added to themeta
tag. Only dimensions in the allowed range are permitted. Any others are ignored and are not reported to GA.It would be good to have some feedback on this approach. I'm aiming to make it as simple as possible for new teams to add an A/B test. With this proposal, they would have to do the following:
<meta name="govuk:ab-test" content="NameOfTest:#{bucket}" data-analytics-dimension="43">
.https://trello.com/c/g9OyC7Pn/310-tell-google-analytics-about-a-b-tests
Before this can be merged:
meta
tag on the A/B example page in frontendmeta
tag in the A/B testing gem (Configure Google Analytics dimension for A/B test govuk_ab_testing#5)