Pass cohort name to universal analytics set dimension #251
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.
During testing of alphagov/smart-answers#2265 we noticed that only the test name was being sent to GA for our custom dimension where we expected to see the cohort name too. After a bit of digging we found that the
MultivariateTest
had not been updated since we removed the classic GA tracker analytics implementation. Old dimensions allowed 4 arguments: the dimension index, a name (this was the name of the test), a value (this was the name of the cohort), and a scope for the data to be set in (this was session scope); whereas new dimensions allow only 2 arguments: the dimension index and a piece of custom data (because all other arguments were ignored this was just the name of the test).We want to pass on the name of the cohort to the dimension so we change the call to set dimension from the
MultivariateTest
to combine the test name and the cohort name and send this as the 2nd argument to the call.While we're at it we update the contact details for the person to communicate with about creating new custom dimensions as it's no longer Ashraf.
/cc @benilovj, @fofr