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.
Ashraf Chohan and Tara Stockford are performance analysts in GDS.
3 comments
Comment by Greg posted on
Thanks, interesting articles. Any plans to make gov.uk's analytics open? Currently I have to ask someone to ask someone to get the analytics for gov.uk pages I'm content owner for. This doesn't help when you've just got a quick question or want a slightly different angle on something. Plus it means I have to be able to explain what I want rather than being able to experiment or just play around looking for interesting things.
Comment by Peter Jordan posted on
Hi Greg. I'm afraid it's very unlikely that we will make access 'open'. To access data 'directly' requires an account and there is already a big overhead in terms of managing and authenticating the number of account holders. It's also important that we support users to be able to draw accurate conclusions from the data.
During the coming year, we'll be working with colleagues in departments and agencies to better understand their needs and improve reporting. BTW, in case you are not aware:
https://insidegovuk.blog.gov.uk/2014/10/29/info-pages-publishing-data-about-user-needs-and-metrics/
and
https://www.gov.uk/performance/site-activity-home-office
Comment by Giles posted on
Thanks, some useful and practical ideas.