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 GA4 accordion tracking to manuals #2514

Merged
merged 4 commits into from
Aug 17, 2022
Merged

Conversation

GDSNewt
Copy link
Contributor

@GDSNewt GDSNewt commented Aug 8, 2022

We are currently working to complete the implementation of GA4 tracking on all accordions, across all frontend apps.

This PR adds tracking to the accordions on the following pages:

Example URL(s):

There are more example pages listed in the manuals publisher docs.

Also, in this PR is a bug fix. Currently, the I18N manuals.updates_amendments string is visible on the rendered page. This is because the visuallyhidden class has been replaced by the govuk-visually-hidden class. The visuallyhidden class has been replaced and appropriate tests added.

Co-authored-by: Graham Lewis <@gclssvglx>

Trello

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 8, 2022 15:35 Inactive
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 10, 2022 14:54 Inactive
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from d934314 to bf12e73 Compare August 11, 2022 09:11
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 09:12 Inactive
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from bf12e73 to 8314af9 Compare August 11, 2022 10:35
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 10:35 Inactive
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from 8314af9 to 6c77bdd Compare August 11, 2022 10:36
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 10:36 Inactive
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from 6c77bdd to 824f08d Compare August 11, 2022 10:48
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 10:49 Inactive
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from 824f08d to b1db951 Compare August 11, 2022 10:54
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 10:54 Inactive
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 12:49 Inactive
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from b018d87 to cd1d2c9 Compare August 11, 2022 12:55
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 11, 2022 12:55 Inactive
@gclssvglx gclssvglx changed the title add ga4 tracking to manual updates Add GA4 tracking to manual updates Aug 11, 2022
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 12, 2022 09:00 Inactive
@gclssvglx gclssvglx changed the title Add GA4 tracking to manual updates Add GA4 tracking to manuals Aug 12, 2022
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from ee224ed to 4b4499e Compare August 12, 2022 10:06
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 12, 2022 10:06 Inactive
@gclssvglx gclssvglx changed the title Add GA4 tracking to manuals Add GA4 accordion tracking to manuals Aug 12, 2022
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from 4b4499e to 331ac86 Compare August 12, 2022 10:28
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 12, 2022 10:29 Inactive
@gclssvglx gclssvglx marked this pull request as ready for review August 12, 2022 10:40
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from 331ac86 to 2ef39d6 Compare August 12, 2022 13:22
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 12, 2022 13:22 Inactive
Copy link
Contributor

@andysellick andysellick left a comment

Choose a reason for hiding this comment

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

Looks good, just a small suggestion to clean the code slightly.

@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from 2ef39d6 to e4201c3 Compare August 15, 2022 13:58
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 15, 2022 13:59 Inactive
GDSNewt and others added 4 commits August 16, 2022 09:56
Currently, the title string that is added to the data-ga4 title tag contains the manuals.updates_amendments I18N string, this is not stripped and is unwanted.

This change adds a helper for sanitising the title string before being added to data-ga4.

Tests are also added.
Currently, the I18N manuals.updates_amendments string is visible on the rendered page. This is because the GOV.UK visuallyhidden class has been replaced by the govuk-visually-hidden class.

We need to replace the visuallyhidden class and update the appropriate tests.
@gclssvglx gclssvglx force-pushed the ga4-tracking-accordions branch from e4201c3 to 3f631ae Compare August 16, 2022 08:57
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-2514 August 16, 2022 08:57 Inactive
@gclssvglx gclssvglx requested a review from andysellick August 16, 2022 11:56
Copy link
Contributor

@andysellick andysellick left a comment

Choose a reason for hiding this comment

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

Looks good. Can we ensure we record some URLs where these accordions are shown?

@gclssvglx gclssvglx merged commit f4204bb into main Aug 17, 2022
@gclssvglx gclssvglx deleted the ga4-tracking-accordions branch August 17, 2022 09:23
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.

4 participants