-
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
Stop redacting dates in GA4 tracking on GOVUK search pages #4223
Conversation
d83e414
to
7d808b4
Compare
7d808b4
to
1d4af5b
Compare
1d4af5b
to
a40c8a6
Compare
a40c8a6
to
5da9980
Compare
5da9980
to
20528f7
Compare
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.
Looks good, just one non-blocking small suggestion.
@@ -78,7 +78,9 @@ window.GOVUK.analyticsGa4.analyticsModules = window.GOVUK.analyticsGa4.analytics | |||
}, | |||
|
|||
getLocation: function () { | |||
return this.PIIRemover.stripPIIWithOverride(this.stripGaParam(document.location.href), true, true) | |||
// We don't want to remove dates on search pages. | |||
var stripDates = !this.getSearchTerm() |
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.
This line gets repeated later - would it be possible to store this value on initialisation?
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.
Thanks @andysellick - good point, i've changed it so that it's only called once. Are you able to re-review?
20528f7
to
5975578
Compare
A recent change in `govuk_publishing_components` removed date redaction from search term updates: alphagov/govuk_publishing_components#4223 The GA4 finder tracking spec additionally tests this behaviour, so was failing when the gem was bumped.
What / Why
standardiseSearchTerm
function, - this function ensures the search term tracks the same across multiple parameters, so dates should no longer be redacted wherever we grab a search term.location
,query_string
, andsearch_term
values in the PageView tracker.Visual Changes
None.