-
Notifications
You must be signed in to change notification settings - Fork 20
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
Extend track click script #2263
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
andysellick
force-pushed
the
extend-track-click
branch
from
August 11, 2021 14:14
1517f1a
to
ef38d93
Compare
andysellick
requested review from
alex-ju,
danacotoran and
injms
and removed request for
alex-ju
August 11, 2021 14:14
injms
previously approved these changes
Aug 11, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat - looks good to me 👍
owenatgov
reviewed
Aug 11, 2021
app/assets/javascripts/govuk_publishing_components/analytics/track-click.js
Outdated
Show resolved
Hide resolved
andysellick
force-pushed
the
extend-track-click
branch
from
August 12, 2021 07:20
ef38d93
to
402b4f2
Compare
andysellick
force-pushed
the
extend-track-click
branch
from
August 12, 2021 07:48
b640af3
to
225ca7b
Compare
- modified so that if no label is provided, the text of the clicked link is included as the label - this will allow tracking to be added to a wrapping element containing links managed outside of an editable template
- allows the tracking to be added to an element so that any links (and only links) within it will be tracked - this prevents other clicks within the same element from being tracked unnecessarily
andysellick
force-pushed
the
extend-track-click
branch
from
August 12, 2021 07:54
401d0b3
to
08b56a6
Compare
andysellick
dismissed
injms’s stale review
August 12, 2021 07:54
I've added another commit and it needs reviewing again.
This was referenced Aug 12, 2021
injms
approved these changes
Aug 12, 2021
owenatgov
approved these changes
Aug 12, 2021
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Modify
GemTrackClick
so that if nodata-track-label
attribute is provided, the text of the link clicked will be used.Why
We want to add tracking to links within an element where the content is managed outside of the template (e.g. a YML file) and the content is subject to change, without having to keep ensuring the links have the right data attributes. This allows us to add the module, action and event attributes to the parent, and the script will automatically use the text of the clicked link as the label.
Visual Changes
None.
Trello card: https://trello.com/c/Q6kr2nFK/551-add-ga-tracking-codes-to-fcdo-call-out-box-of-covid-info