Add analytics dimension for A/B tests #888
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link meta tags named
govuk:ab-test
to a custom Google Analytics dimension. The value of the meta tag and the dimension is a combination of the test name and bucket name, such asEducationNavigation:B
.This links to existing session dimension 13, which has been used for A/B tests in the past.We're not going to use the existing A/B test dimension (13) so that it can continue to be used by JS-based A/B tests. Tara has reserved dimension 40 instead.Note that only one A/B test can use this dimension at once, otherwise the value will be overridden by different tests.
Trello: https://trello.com/c/g9OyC7Pn/310-tell-google-analytics-about-a-b-tests
meta
tag on the A/B example page infrontend
to match the expected structure (Make A/B test meta tag consistent with Google Analytics JS frontend#1110). When I added it, I thought it would just be used by the Chrome extension, but it's simpler to update the tag and the extension than to add more logic to this analytics code.