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 Google Tag Manager code to the frontend docs #119

Open
4 tasks
Tracked by #133
vanitabarrett opened this issue Apr 21, 2021 · 1 comment
Open
4 tasks
Tracked by #133

Add Google Tag Manager code to the frontend docs #119

vanitabarrett opened this issue Apr 21, 2021 · 1 comment

Comments

@vanitabarrett
Copy link
Contributor

Similar to alphagov/govuk-design-system#1616

What

Add Google Tag Manager code snippet to the frontend docs

We should be ok to merge these changes as the Google Tag Manager code relies on consent being given for analytics cookies, which a user can't do if we add this before we add the cookie banner.

Why

We need to add the Google Tag Manager code to the frontend docs so we can use analytics to track pageviews and events.

Who needs to know about this

Developers; Performance Analyst

Done when

  • Talk to Sara about what code needs to be added (get the ID)
  • Google Tag Manager code should only be loaded when consent has been given for analytics cookies
  • Load GTM and trigger a pageview event as soon as analytics cookies have been accepted - don't wait for the next pageview
  • Tests for the above functionality
@owenatgov
Copy link
Contributor

We've now moved the design system website to GA4 as part of alphagov/govuk-design-system#3822. From this, I'm not confident about this comment:

We should be ok to merge these changes as the Google Tag Manager code relies on consent being given for analytics cookies, which a user can't do if we add this before we add the cookie banner.

...because some of the GA4 cookies are now appearing on the frontend docs website. I think this is to do with how the domain for the GA4 cookies are being set aka .design-system.service.gov.uk as opposed to design-system.service.gov.uk; note the dot.

Currently this cookie isn't collecting any analytics data because we haven't got the analytics script on the frontend docs yet. This may also be fine as we don't currently have any data collection present via Google Tag Manager specific to the frontend docs. It's worth double checking that this is still the case, otherwise this will need to be done in tandem with #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog 🏃🏼‍♀️
Development

No branches or pull requests

3 participants