Skip to content
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

Use analytics’s `callOnNextPage` to set search position #777

merged 1 commit into from Mar 25, 2015


Copy link

@fofr fofr commented Mar 20, 2015

Rather than a Classic Google Analytics implementation (which Static has a shim for), use the new callOnNextPage method to indicate that the search position dimension should be set on the following page.

This method does occasionally produce bad data, as explained by @rboulton, but this is something we hope to address separately:

One problem we've seen with the existing implementation of this is that sometimes the cookie data gets loaded on the wrong page (presumably due to the target page failing to load, etc). I've wondered if it would be good to include the expected target page url (or a hash of it, for brevity) in the cookie data, and only perform the action on the target page if the url matches, to strip out this confusing data.

Rather than a specific Classic GA implementation (which Static has a
shim for), use the new `callOnNextPage` method to indicate what should
happen on the next page.

This will then be tracked in everything it needs to be, not just
classic analytics.
fofr added a commit to alphagov/static that referenced this pull request Mar 20, 2015
The technique for setting analytics calls for a following page was
updated in #560 and uses of the
old technique updated in alphagov/frontend#777.

* Remove shim
* Simplify tests
Copy link

@edds edds commented Mar 23, 2015

This looks good to merge to me once static is out, 👍.

fofr added a commit that referenced this pull request Mar 25, 2015
Use analytics’s `callOnNextPage` to set search position
@fofr fofr merged commit fb22f6c into master Mar 25, 2015
1 check passed
1 check passed
default "Build #669 succeeded on Jenkins"
@fofr fofr deleted the next-page-analytics branch Mar 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.