Add element tracking to track click #2283
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.
What
This PR also adds some documentation for this script, since it's been having some new features lately.
Why
We want to track link clicks in the second grey box on pages like https://www.gov.uk/foreign-travel-advice/spain (underneath 'Summary') but that box and all the text below it is managed through a publishing interface, so we can only apply tracking stuff to a parent element. This allows us to provide the classname of the grey box so that only links clicked in that box are tracked.
Visual Changes
None.
Trello card: https://trello.com/c/JREgQ2iv/579-spike-into-tracking-enhancements