Getting Analytics data for designing
Google Analytics is widely used to gather information about how users interact with websites. As a developer, designer or product owner it’s really useful to use the information it collects to inform decisions. However, I often find that the Google Analytics interface can get in the way of getting the right data out quickly.
Instead I prefer to use the Google Analytics Query Explorer to get information out. The Query Explorer was initially designed to help developers construct queries for the Google Analytics API. It also works really well for getting specific information out of Google Analytics when you want to do your own data analysis.
The way that the Google Analytics API works is very similar to using an OLAP cube, you define the dimensions and metrics for the data you want to retrieve. You can think of dimensions as the discrete data sets, for example: browser name, page path, custom event name. Metrics on the other hand are the measurable value to go with your dimensions, for example: pageviews, page load time, goal completion numbers.
Using dimensions and metrics along with some filters and sorting I find you can easily get a much wider array of information out than you would be able to using the Google Analytics web interface.
For example if you wanted to see what browsers your users are using you could run:
dimensions = ga:browser metrics = ga:users sort = -ga:users
Using a GOV.UK analytics profile this would get you something like: (view with your own data in the Query Explorer)
I like to then add onto that date or time dimensions. This then lets me plot the number of pageviews (or other metric) over time. So for example if I wanted to see IE usage over time I could extend the previous query with something like:
dimensions = ga:browser,ga:hour,ga:dayOfWeek metrics = ga:users filters = ga:browser==Internet Explorer
Which would get you something like: (view with your own data in the Query Explorer)
|Browser||Hour||Day of Week||Users|
Then using the TSV export button in the Query Explorer, found at the bottom of the page, I can import the results into a Google Sheets and produce a quick graph of the data.
For another example if we had a page which used a query string to let users filter by a date field. You could get back all the different dates people filtered by:
dimensions = ga:pagePath metrics = ga:uniquePageviews filters = ga:pagePath=~.*from_date=[^&$]+.* sort = -ga:uniquePageviews
This would get you something like: (view with your own data in the Query Explorer)
Using the TSV export in this case I could then parse the file using Ruby to generate the information I really want. You could also add onto that some date dimensions and see if the dates people pick, relative to the date they filtered for it, changes over time.
Obviously the Query Explorer is much more powerful than I have shown in these three examples, but hopefully this gives you an example of the kinds of things you can use it for. I rarely use the Google Analytics web interface directly any more preferring to graph or otherwise parse the data coming out of the Query Explorer myself.