We’ve been using Google Analytics on GOV.UK for the past 3 years to gain insights into the behaviour of our users. As our knowledge of the product has grown, we’ve regularly explored original ways of using the interface functionality and the API. This experimentation has opened up new understanding of user behaviour which wasn’t available to us before.
We’ve regularly blogged to share what we’ve done, so here’s a roundup of some of the most interesting ideas.
1. How to create heatmaps to summarise user navigation
This post first talks through a method of using filters to aggregate sections of a site. It then shows how the data can be pivoted to create heatmaps which show the relative navigations between sections.
2. Making the most of real-time data
Here we’ve written about some of the ways we’ve been using real-time data, including setting up a screen in the office which streams search terms users are entering and the most popular pages being viewed. We also show a way we’ve used the real-time dashboard functionality to display how users are progressing through the sections of one of our services.
3. ‘Hacking’ Google Analytics to get real-time internal search terms data
Google Analytics, by default, does not provide the ability to view internal search terms being entered in real time. However, we found a way to see real-time searches without using any code.
4. Monitoring search performance on GOV.UK
Our developers managed to track the position of internal search results that people are clicking, by using a cookie to set a custom variable on the destination page. This makes it much easier to identify queries with ranking problems, when lower results are getting more clicks than we’d normally expect.
5. How to monitor trending searches with Google Sheets
Using Google Sheets we set up a dashboard to see site search terms that people are using more than usual. By filtering out searches that are popular all the time, you can focus on what’s new or topical, to make sure people can find what they need.
6. Automating email alerts for ‘trending’ content
The ‘Intelligence alerts’ functionality in Google Analytics is a great feature to highlight unusual trends on a site. However, there are some limitations. On GOV.UK, departmental content is defined by a page-level custom variable, a metadata type value in the source code. It’s not possible to configure alerts by custom variables so we used the API to pull usage data in the past hour and email stakeholders if there’s a spike in pageviews.
7. Opening up performance data
And finally, we want to mention our Performance Platform, a tool for sharing government service performance data.
The platform provides direct integration into several online analytics tools, including Google Analytics. Data is collected into a database via the API using Python and JSON. This is then rendered in the front end using a D3 library and augmented with other management information to deliver transparent and comparative performance metrics across government services.
We will keep experimenting to extract more value from Google Analytics and will continue to blog our findings.