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

Add element tracking to track click #2283

Merged
merged 3 commits into from
Aug 24, 2021

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented Aug 24, 2021

What

  • allows us to specify an element class within which link clicks will be tracked
  • caters for the situation where we want to track specific links within a govspeak block and can't get to the source, except from a high level parent element

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

@bevanloon bevanloon temporarily deployed to govuk-publis-add-elemen-rdedfa August 24, 2021 09:35 Inactive
@bevanloon bevanloon temporarily deployed to govuk-publis-add-elemen-rdedfa August 24, 2021 10:28 Inactive
- allows us to specify an element class within which link clicks will be tracked
- caters for the situation where we want to track specific links within a govspeak block and can't get to the source, except from a high level parent element
@andysellick andysellick force-pushed the add-element-tracking-to-track-click branch from 0c99805 to 6435432 Compare August 24, 2021 12:57
@bevanloon bevanloon temporarily deployed to govuk-publis-add-elemen-rdedfa August 24, 2021 12:58 Inactive
@bevanloon bevanloon temporarily deployed to govuk-publis-add-elemen-rdedfa August 24, 2021 12:58 Inactive
docs/track-click.md Outdated Show resolved Hide resolved
Copy link
Contributor

@injms injms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor quibble about escaping ", but nothing that should block this from being merged in.

🦖

- update intro to analytics documentation
- add documentation for the track click script
@andysellick andysellick force-pushed the add-element-tracking-to-track-click branch from 330ba33 to 1723d50 Compare August 24, 2021 15:45
@bevanloon bevanloon temporarily deployed to govuk-publis-add-elemen-rdedfa August 24, 2021 15:45 Inactive
@andysellick andysellick merged commit c35d435 into master Aug 24, 2021
@andysellick andysellick deleted the add-element-tracking-to-track-click branch August 24, 2021 15:51
injms added a commit that referenced this pull request Aug 24, 2021
Includes:
 * Add element tracking to track click (#2283)
 * Fix navigation header layout error that occurs when resizing browser window (#2281)
 * Fix navigation header search toggle focus hover states (#2284)
@injms injms mentioned this pull request Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants