Skip to main content

7 ways we’ve used Google Analytics ‘outside the box’

Posted by: and , Posted on: - Categories: Google Analytics, Google Sheets, Implementation

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.

Heatmap of navigation between sections
Heatmap of navigation 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.

Real-time search screen in our office
Real-time search screen in our office

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.

Real-time internal searches dashboard
Real-time internal searches dashboard

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.

Chart showing internal search click positions
Example of unusual click distribution, with more clicks on the 4th and 5th results

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.

Trending search terms on GOV.UK
Trending search terms on GOV.UK

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.

Example of an email alert
Example of an email alert

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.

The GDS Performance Platform
The GDS Performance Platform


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.

Sharing and comments

Share this page


  1. Comment by Greg posted on

    Thanks, interesting articles. Any plans to make's analytics open? Currently I have to ask someone to ask someone to get the analytics for 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.

  2. Comment by Giles posted on

    Thanks, some useful and practical ideas.