Back in
Episode 10 of Web Analytics TV, (32:00), Lisa C from Melbourne asked how to pull a trending report from Google Analytics for the top organic search landing pages. This was such a great question, that we wrote
2 articles and
released sample code describing how you can automate retrieving this data from Google Analytics Data Export API. But first let’s look at the results.
Here is a graph plotting traffic to the top 100 landing pages for organic search for all of June for www.googlestore.com.
Let’s Analyze. This is the typical trend graph you can find across the Google Analytics web interface. By itself, all you can tell is that something happened during the spike. What you can’t figure out is which page actually increased in traffic; to do so would require lots more digging.
Now let’s try again. Here is a stacked area graph of each of the top 100 landing pages for organic search.
Let’s analyze again. Awesome, right? It's obvious why this is better - there's more context. Notice how much more we can get from this graph. We can see the green page is what caused the big spike. Also we see that the blue and orange pages had interesting changes in traffic patterns; changes we couldn’t identify from the first graph. Being able to break down the totals is indeed a gold mine for analysis. What actions might you take from these insights? Perhaps you should get your organic search keywords to send traffic to the blue page. Then, identify the keywords sending traffic to the green and orange page and see if you can increase traffic to other pages.Exporting the Data from the web interface: Anybody can pull this data from the Google Analytics web interface - but it's a bit of work. You create a custom report with landing pages and entrances. Then drill into each landing page, and export the data to a csv file. Finally you go through all csv files and compile them into a single file for analysis. Let’s illustrate:Going through each report individually is a LOT of manual work, but we can automate all of this using the Data Export API, reducing hours of work into a few minutes!
Using the Data Export API to Automate We mentioned we wrote two articles about the above graph. In the first article , we demonstrate how to use the Data Export API to automate the exact task above. A user specifies 1 query to determine the top landing pages. Then, for each landing page, a separate query is used to get the data over time.This is great and we built it to work with any query with a single dimension. But notice that the number of queries grows with the number dimensions. In fact this program requires n + 1 queries so if you want data for 1,000 dimensions, it will take 1,001 queries.
This is bad because there is a daily quota of 10,000 queries for the Data Export API. So if you ran this program 10 times, with 1,000 dimensions, it would require 10,010 queries completely using your quota. ouch!Optimizing Data Export API Requests The second article describes an alternate approach to retrieving the same data, but minimizes the number of queries required. In this article, we use Data Export API filter expressions to return data for multiple dimensions in each request.
This approach dramatically reduces the amount of quota required. In the best case, only 2 queries are required.
Using this second approach allows analysts to run this report to their hearts content; for different time frames and different dimensions, comparing organic vs paid traffic, trends of keywords by search engine,and even traffic by geography. In addition to the two articles describing both approaches, we've released the sample code for the application . We hope you use it! In the comments below, let us know the insights you find through using this tool.
Posted by Nick Mihailovski, The Google Analytics API Team