have new GA4 properties set up (at least one for production and for preview), with appropriate access for the member of our teams.
port relevant features from our current analytics set up to GA4
back up data from UA and figure how to analyse it in the future
There are a couple of key things we'll want to make sure to keep:
Respecting users consent
Analytics are only enabled after users give their consent to cookies
Analytics get enabled or disabled based when users update their consent on our cookies page
Tracking pageviews
Tracking search queries
Having separate properties collecting analytics for production and preview statistics (this is done through a variable in Google Tag Manager)
Other features should first be reviewed before being re-implemented in GA4:
custom triggers and custom tags currently let us track a variety of user interactions (eg. copying code examples), but it's unclear if all are still useful.
Finally we should also make sure our set up is well documented to make future changes easier.
### Migrate Design System site
- [ ] https://github.com/alphagov/govuk-design-system/issues/3856
- [x] Create GA4 properties (one for production and one for review apps)
- [ ] https://github.com/alphagov/govuk-design-system/issues/3863
- [ ] https://github.com/alphagov/govuk-design-system/issues/3864
- [ ] https://github.com/alphagov/govuk-design-system/issues/3865
- [x] Review data collected by GA4 against UA data
- [ ] https://github.com/alphagov/govuk-design-system/issues/3874
- [x] --- 1st of July ---
- [ ] https://github.com/alphagov/govuk-design-system/issues/3857
- [ ] https://github.com/alphagov/govuk-design-system/issues/3870
- [ ] If necessary, set up analysis tool for exising UA data
- [ ] https://github.com/alphagov/govuk-design-system/issues/3878
- [ ] https://github.com/alphagov/govuk-design-system/issues/3879
### Process/documentation
- [x] Ensure Frontend doc repository has an 'analytics' label like our other repositories
- [ ] Update documentation for process for managing users and properties on Google Analytics and GTM
- [ ] Document variables/tags/triggers of the GA4 setup
### Stretch goals
- [ ] Review JavaScript variables in GTM for unnecessary code (eg. polyfills)
- [ ] Reinstate the tag tracking text copies (if accurate enough)
- [ ] Make a report on navigations to GitHub discussions from link at bottom of our components/patterns pages
- [ ] Investigate if we can access search terms on external search engines which led people to our site
- [ ] Fix external link event considering internal navigation as external clicks on preview sites
Brief
Migrate the analytics set up on the Design System site to GA4, as Universal Analytics (our current set up) is being retired on July 1st.
This'll require us to:
There are a couple of key things we'll want to make sure to keep:
Other features should first be reviewed before being re-implemented in GA4:
Finally we should also make sure our set up is well documented to make future changes easier.
In addition to migrating the Design System site, we'll want to look at collecting analytics on the Frontend Docs as well.
As a stretch goals, we could:
Epic lead
@romaricpascal
Driving role(s)
Developers
Supporting roles
Product manager, User researcher
Further detail