Google Analytics 4 (GA4)
Setup
Google Analytics offers both free and enterprise analytics tools to measure website and app data. The most recent offering is Google Analytics 4 (GA4) and has different setup steps to the older analytics package, Universal Analytics.
These steps assume that you use Google Tag Manager and the Design System tracking script to deliver analytics on your site.
-
Create your account and name it appropriately
-
Create your Property
-
Do not turn on Google Signals
-
Turn off ads personalisation
-
Switch Reporting Identity to Device-Based
-
Change the data retention to 14 months
-
Set up GA4 to only run on one domain
-
Turn on automated link tracking within enhanced event measurement
-
Turn off automated site search tracking (instead we do this as we transform site searches to lowercase using Google Tag Manager)
-
Copy your GA4 measurement ID and add to the Google Tag Manager variables file along with the site’s domain name
As with any site, after doing all of this you’ll still need to sort out your reporting dashboards, cookies controls, privacy statement, manage your access to your accounts, etc.
Additional reading
Google Analytics 4 (GA4) Checklist – The Complete 2023 Edition (lovesdata.com)
The Traffic Source Challenge in GA4 - Charles Farina's Blog
Help with metrics and dimensions - https://data.ga4spy.com/ and https://ga-dev-tools.google/ga4/dimensions-metrics-explorer/
Feedback, help and support
If you need help or support you can e-mail us at designsystem@gov.scot
There is a problem
Thanks for your feedback