Everything we do on GOV.UK is centred around providing the best possible experience for our users. We want the site to be fast and straightforward for everyone. To achieve this we need to understand how people use the site - this is where analytics are useful.
Data gathered by analytics helps us answer questions like:
- what are the most common tasks that people do?
- are people finding what they want?
- which parts of the site are slowest?
Understanding how people use GOV.UK helps us to learn what is working well and what isn't. We can then use this information to make the site better for everyone.
The only direct analytics tool we use is Google Analytics (GA). Google intends to replace the current version of GA (Universal Analytics or UA) with a new version in the near future. This means we need to upgrade to the new version or we’ll lose a valuable way of understanding GOV.UK users.
We’ve already talked about our preparations for upgrading to Google Analytics 4 (GA4). Now that we have successfully implemented GA4 onto GOV.UK, we wanted to explain:
- the technical side of the implementation
- what we’ve learned
- what’s coming next
What we’re doing and why
We wanted to implement GA4 using Google Tag Manager (GTM). Whilst we did consider alternatives, GTM came out as our best option. It allows for easier sharing of data collection methodologies, provides a preview and testing mode, and is already widely used across government.
As Daisy explained in her earlier blog post, we’ve decided to run both the old and new versions of GA together on GOV.UK for 12 months. We want to test everything is working, compare the data and understand any discrepancies, and to give users and departments time to migrate. If we just flipped from UA to GA4 we'd run the real risk of not discovering any issues until it was too late.
What we’ve learned
GOV.UK is already fast to load, so users with modern devices on good connections probably won’t notice any difference. We’re more concerned about the impact on users with older devices on slower connections.
Plans for going live
GOV.UK uses Real User Monitoring (RUM) to help us understand how the site performs for users. It only works on the live site, so we couldn’t properly test the performance impact until we put the new code live.
We discussed the potential performance impact of dual-running with a range of people across GOV.UK, including developers, analysts and senior management. We had to communicate clearly what this meant, and have plans in place if the performance wasn’t acceptable.
The performance impact
We monitored the performance of 5 of the most visited pages on GOV.UK for 2 weeks using RUM. We focused particularly on older devices that would be more likely to notice a performance change.
Interaction time and perceived performance are important as they let the user know that the page is now in a usable state. Even a 50 millisecond difference in the performance of a page can make a page feel slow to a user, especially on low specification devices, which will likely feel the impact a lot more than faster devices.
Using RUM data we were able to show that the impact of GTM was negligible. This confirmed our initial thinking and meant we can now proceed to use GTM to implement GA4 without an impact on our users.
Since the launch at the end of September 2022, we’ve been continuing to add the remaining analytics to our GA4 setup, as well as testing and adjusting the existing work. This is a large task and we have limited time to complete it before UA is shut down in 2024.
We’ll continue to monitor the performance of GOV.UK as the work continues. We’ll also continue to ensure that all of the data collected fully respects people's consent, is anonymous, and is free of personally identifiable information.