Google Analytics sampling work-around with Google Sheets

Do you get a lot of traffic to your website? Maybe more than 500,000 sessions per month, or even per week? If you answered yes and you’re using the free version of GA, you know it’s a pain to run reports with any advanced segment or secondary dimension applied.

Here’s a way to automate this reporting using the Google Sheets GA add-on. If you haven’t used Google Sheets GA add-on before, please refer to this introduction.

In our scenario I’m assuming we’re having over 200,000 sessions per day, so we need to export the data on a daily basis and combine it for the month. Here’s a link to the Google Sheets template I’m using that you can save in your account by clicking File -> Make a copy.

Here’s how to populate the template, you need to fill-in the yellow fields only:

Sampled data template

  1. In the yellow fields in column A put your dates. In my example these are the individual dates of January.
  2. The View ID field should be the ID of your GA view. If you don’t know it, go to Google Analytics -> Admin -> View Settings and get your View ID. Don’t forget to add ga: in front of the number.

View settings

3. Metrics & Dimensions – you should list your metrics and dimensions in these fields, formatted in such a way that the GA API can understand them. You can refer to the list of popular dimensions and metrics in the right section or click the links below the fields to select the proper dimensions and metrics. You can pull up to 7 dimensions in one report.

4. Segment – I’m interested in traffic from mobile devices, so in the Segment field I’m building my segment. For a quick reference what’s possible with segments, check out the documentation using the link below the field.

5. Filters & Sort – if you need to use a filter you can do so here, and also sort the data.

6. Run the report – select Add-ons -> Google Analytics -> Run reports. In order to run the report you need to login to Google Sheets with the same email, that’s added as user in Google Analytics. You’ll get an upgrade notice the first time you run the report.

Now we have all the data we need. If you’re interested in summary metrics, you can see the results in tab Summary. If you need to get a list of the dimensions, check out the Collect tab. You can export it from there, clean up the headers, do a pivot table in Excel or Google Sheets and get the report you need.

Good luck!

5 Google Analytics posts you don’t want to miss in December

Here’s again the last post of the month saved for the top 5 interesting Google Analytics related resources I found on other sites. Here are the five for December – you may want to bookmark those as they can be very useful:

The Value of Google Analytics Data Driven Attribution

Google Analytics Premium offers Data Driven Attribution as an additional model you can use, in addition to things like Last Click Attribution. The key here is that rather than using static proportions for their model, they use algorithms instead.

Data Driven Design

Designing a new website is a big task. You must take many things into consideration and ensure that all of the analytics tracking is properly setup and collecting the necessary data for you to report on success. Learn which are the key metrics to consider when thinking about a website redesign.

#GTMTips: URL Source In The URL Variable

In this quick tip Simo Ahava shows one of the less-known features of Google Tag Manager – the URL Source setting in the URL Variable type. It lets you parse any URL String for its components.

Common Reporting Pitfalls in Google Analytics

Another interesting post from Luna Metrics describing a few common pitfalls in the world of Google Analytics reporting – and how to avoid them. You’ll understand more about sessions by page, users by source or medium and averages of averages. Very useful!

Complete Guide to Google Tag Assistant

Another detailed post by Himanshu Sharma explaining what is Google Tag Assistant, how to use it like a pro and understand its results. There’s also a follow up, showing how to use Google Tag Assistant recording feature and read the reports: Guide to Google Tag Assistant Recordings

P.S. Got a Google Analytics question? Send it to me and I’ll try to answer it on the blog.

5 Google Analytics posts you don’t want to miss in November

Here’s again the last post of the month saved for the top 5 interesting Google Analytics related resources I found on other sites. Here are the five for November – you may want to bookmark those as they can be very useful:

Why Adwords and Google Analytics data don’t match & how to fix it

This is a detailed post by Himanshu Sharma answering the very common question why AdWords show more/less conversions than Analytics. Check this one for troubleshooting ideas first, or use it to explain the differences to your boss / client.

Tracking Complex Interactions in Dynamically Added Cross-Domain Iframes – Google Analytics & Iframes

Part 1
Part 2
Part 3
Part 4

All 4 blog posts of the Luna Metrics series on tracking iframes: from tracking simple user interactions within cross-domain iframes by using the postMessage API, complex interactions when the iframe in question is on the same domain as the parent frame, tracking user interactions cross-domain when the iframe is added dynamically using JavaScript and tracking user interactions cross-domain when the iframe is added server-side.

Iframe Cross-Domain Tracking In Google Tag Manager

Simo Ahava also shares his approach for tracking iframes across domains, using the hitCallback method to decorate the iframe properly with cross-domain tracking parameters to ensure that any tracking that takes place within is attributed to the original session and user.

Introduction to Piwik – Best Google Analytics Alternative

Another Optimize Smart post presenting Piwik as a free alternative to Google Analytics. It explains its key benefits, possible paid options for cloud services, and how to install it on your website.

#GTMTips: Referral Exclusion On Receipt Page

In this quick tip Simo shows a simple and elegant way to make sure that no Ecommerce payment gateway referrals interferes with correct attribution on the ecommerce receipt page, so there’s no need to constantly update the Referral Exclusion List in Google Analytics.

P.S. Got a Google Analytics question? Send it to me and I’ll try to answer it on the blog.

No data in new GA view

Here’s a quick tip if you have recently created a new view for a GA property but it doesn’t collect any data after 24-48 hours.

First, check your filters – do you have an include filter that may cause issues?

Second, if you have enabled the User-ID feature (under Admin – Property – Tracking Info – User-ID) when you create a new view you’ll have an extra field to set:

user ID view

If you aren’t using the User ID feature (passing unique identifier to GA for logged in visitors), you shouldn’t turn this option on. Just leave it on OFF as it’s by default.

If you check it and don’t send any user IDs the view won’t show any data!

P.S. Got a Google Analytics question? Send it to me and I’ll try to answer it on the blog.

What organic keywords are driving traffic to your site?

Since Google started hiding organic keywords back in 2011, it’s common to see more than 95% – 99% grouped as (not provided) in your reports.

When you go to Acquisition – All Traffic – Channels and click on Organic Search you’ll see the sad reality. If you switch the primary dimension to Landing Page, you get a list of the top pages driving organic traffic and their respective conversions.

Most probably you know what keywords these pages are attracting (based on the content / topic), but it’s always useful to double check if there are new search terms you haven’t thought about and possibly get ideas for new pages.

One way to understand what search queries are driving organic traffic to your site is to use Google’s Search Console (previously Google Webmaster Tools). Let’s first export the top 10 landing pages from organic search.

Now go to Search Console and select Search Traffic – Search Analytics. Under Dates select the same time period – last 30 days is default, and you can go up to the last 90 days. Under Pages create a filter for the top landing page in your list. Now you’ll see the actual search queries people used to reach this page of your website from Google:

Search keywords

You can download the list and repeat the process for the other top landing pages.

Although you can’t tie a keyword to conversions, it still gives you a much better idea about the search intent and why people arrive at your pages from Google Search.

P.S. Got a Google Analytics question? Send it to me and I’ll try to answer it on the blog.