How to Connect Tableau and Google Analytics | LunaMetrics

How to Connect Tableau and Google Analytics

/

blog-connect-tableau-ga-tinypng
Ah, the lure of shiny objects. Tableau’s beautiful, interactive data visualizations long tempted me, but it wasn’t until they introduced the direct connection to Google Analytics that I finally took the bait. And was immediately disappointed.

It’s not that the visualizations are disappointing – my Tableau dashboards are great for interacting with GA data, and my clients are delighted with them! The letdown was in the Tableau and Google Analytics connector.

In this post, I’ll show you how the connector is supposed to work – and then show you how it can go wrong.

It’s Simple, Until It Isn’t

On the surface, connecting Tableau and Google Analytics looks straightforward and simple. You give Tableau permission to access your GA data, and then describe the data you want.

The connection process may be found in several places online, including Tableau’s own documentation, of course. I’ll recap here, for reference later when I talk about the pitfalls.

First, click “Connect to Data” and choose “Google Analytics” under More Servers… Sign in to the Google Account you use to access GA, and click “Allow” when Tableau asks for permission.

Then tell Tableau what data you want to see. Select the options presented as Steps 1, 2, and 3. See what they did there? It’s easy as 1-2-3!

3 Steps to Connect Tableau and Google Analytics

Step 1: Choose an Account, Property, and Profile (View)

Step 2: Select Filters (Date Range and Segment)

Step 3: Select up to 7 Dimensions and 10 Measures

Tableau sets Date as a dimension by default, and you’ll probably want to keep it. Search the list to add another dimension. (Or more, if you’re feeling lucky. See “Common Pitfalls” below.)

Then select your GA metrics, called measures in Tableau. Choose one of the suggested “Measure Groups” or search for specific GA metrics.

Where to See Data After You Connect Tableau and Google Analytics

After you have selected at least one item in every dropdown list, for all 3 steps, you can tell Tableau to pull the data. In a new workbook, Tableau will helpfully highlight the Sheet 1 tab as shown here. In an existing workbook, click any sheet or click the next icon to add a new sheet.

When you go to the sheet, you’ll see the name of your data source at the top of the left navigation pane, followed by the list of dimensions and measures you requested. Plus a couple extras in italics, like Number of Records. Metadata: bonus!

Bonus Data When You Connect Tableau and Google Analytics

Now you’re all set to start visualizing that data, right? Maybe. Maybe not.

Common Pitfalls

About the only thing that can go wrong in Step 1 is that your GA account has poorly named properties or views, but that’s not Tableau’s fault. Go fix the names so you can tell what they are!

It’s a different story for Steps 2 and 3.

In Step 2, you have the option to “filter” your data. Tableau recognizes that it’s not a good idea to ask for ALL THE DATA – and Step 2 provides two ways to define a smaller data set.

Wait, why can’t you ask for all the data? In a word: Limits.

Pitfall #1:

The GA connector is bound by the limits of the Google Analytics API, which means you can’t ask for more than 10,000 rows of data at a time.

Pitfall #2:

If you ask for any segment of data that GA has to calculate by searching through a really large set (500,000 sessions or more), then GA will estimate total results based on a sample of that data.

The worst part is that Tableau doesn’t warn you when it returns incomplete or inaccurate, sampled data.

Pro Tip: Use the API Query Explorer! Enter the same date range, segment, dimensions, and metrics.

The Query Explorer will tell you (1) how many rows of results were available (even though it returns 10K rows max), and (2) whether or not the data was based on a sample.

You can also download the results from the Query Explorer and view them in Excel. To see what Tableau pulled from GA, click the table icon (“View Data”) at the top of the left navigation pane, next to “Dimensions”. Select all, click “Copy” and paste into Excel to compare.

View Data Table After Connecting Tableau and Google Analytics

You may have noticed this doesn’t solve the problem, but only alerts you that a problem exists. Read on!

Pitfall #3:

You can’t use “filters” in the Google Analytics sense, at least not to reduce the volume of data in your request.

Sure, Tableau lets you choose segments – er, ONE segment – to reduce the size of the data set. But for GA there’s a big difference between segmenting and filtering.

In Google Analytics, you can use the search box on any table to filter what data is displayed. The act of filtering simply removes some rows from the existing table.

On the other hand, when you apply a segment, it’s like asking GA to search all the data in your property and create a brand new table. This can result in sampled data, Pitfall #2.

In Tableau, if you want to remove some rows you have to pull the data first, and then filter it. Not having this option can result in getting cut off at 10K rows, or incomplete data, Pitfall #1.

Does it feel like we’re going in circles here? One more pitfall, this time from Step 3, Selecting Dimensions and Measures.

Pitfall #4:

If you ask for too many dimensions, you may get sampled data.

Google Analytics pre-aggregates certain combinations of dimensions and metrics, to produce the default set of tables also called “standard reports”. If you ask for a combination of dimensions that was not already calculated, GA has to create a brand new table. Same as with segments!

Examples: Add Device Category to a dimension like Source/Medium. Add Page to Event Category, Action, and Label. It’s not obvious, and there’s no warning.

If you’re a Google Analytics Premium customer, see the note at the bottom for ways around this issue!

Again, use the Query Explorer to discover the problem. Maybe you’ll find there is no problem. Swell!

But if there is a problem, what are you going to do about it?

Web Data Connector to the Rescue

The newest version of Tableau introduced a feature called Web Data Connector, which you can connect to Google Sheets!

This means you can use the Google Spreadsheet Add-On for Google Analytics, build the tables you want using filters if needed, and then connect those tables to Tableau.

Using the Add-On in Google Sheets gives you another advantage. You can combine API data from multiple queries before sending it to Tableau.

This supports the most common remedy for sampled data: reducing the date range. But it also allows you to combine data from different views, properties, or even accounts.

Why Bother?

You may be wondering, “Why not just use GA for reports and analysis?” Isn’t this a lot of bother to re-create something that already works pretty well?

It’s true there are already many features in Google Analytics reports, such as secondary dimensions and charting options among others, that are great for exploring your data and producing reliable, accurate reports.

And it’s true you could produce something in Tableau that is less functional than what’s in GA.

But it’s also possible to go way beyond.

Quick Viz Example from Connecting Tableau and Google Analytics

With Tableau, you can:

  • add interactive features customized to your audience, e.g. list selectors
  • rename and re-group dimensions and measures, and create hierarchies
  • easily join data to provide context and improve readability

As long as you’re aware of the pitfalls and are prepared to address them, you’re ready to start visualizing.

Google Analytics Premium and Tableau

Just a quick note – the main takeaway here is that when Tableau requests data from Google Analytics, you’re subjected to the same sampling limits that would typically apply in the interface and the Core Reporting API. If you’re a Google Analytics Premium customer, this means there are steps you can take to overcome many of these pitfalls – mainly using Custom Tables to tell GA which reports should be unsampled.

We’ll save GA Premium and Tableau for a later post, but in the meantime you can read more about unsampled data, Custom Tables, and Google Analytics Premium.


Have you faced any pitfalls connecting Tableau and Google Analytics? How did you work around them? Have you tried the new Web Data Connector yet? Please share in the comments.

Dorcas Alexander is the Analytics Department Supervisor. Her path to LunaMetrics followed stints in ad agency creative, math, and computer science. Dorcas has a master's degree in language and information technologies from Carnegie Mellon University, where she helped build precursors to a Universal Translator. One of the top-rated tournament Scrabble players in Pennsylvania, Dorcas has an insatiable drive to compete and win.

  • http://www.analyticsedge.com Mike Sullivan

    Dorcas, as an FYI: The Google Sheets addon is still limited to the 10,000 row limit, is subject to the same sampling problems, and requires a bit of technical API knowledge to use filters or segments.

    Analytics Edge makes a free Excel add-in that allows you to download Google Analytics data to Excel (Windows only) that gets around the problems.
    – no 10,000 row limit; it will automatically get up to 1 million rows of data
    – option to warn of data sampling
    – custom filters and segments can be created with point-and-click interface (no API knowledge necessary)
    – offers ‘minimize sampling’ option that will make multiple queries (per date period; month, week or date) and transparently joins the results
    It also have no account or query limits.

    • Dorcas Alexander

      Thanks for commenting, Mike. Analytics Edge is a good, free tool, and I’ve also used Excel to import data to Tableau. I’ll be writing my next blog post about how to get around the 10K row limit and sampling issues in Google Sheets and connecting sheets to Tableau via the Web Data Connector.

      • David H.

        Dorcas, have you been able to write the post on getting around the 10K row limit? Can you share a link.

        Thanks!

  • http://www.mifrie.de Michael Friedrich

    Thank you for this very interesting article, Dorcas.

    I am in the middle of testing Tableau as visualization tool for GA and also came across the shortcomings of the Connector and the GA API. It looks to me as if we have to use a third tool as a middleware, be it Excel or Google spreadsheets.

    Regarding Pitfall #2: Tableau does show a warning for sampled data, as is visible in the attached screenshot (“Stichprobe erstellt” means “Sample generated” in German).

    • Dorcas Alexander

      Thank you for sharing that screen shot, Michael. I have not seen that warning yet, but it’s good to know it exists. I will be writing about the Web Data Connector in my next blog post and also how I avoid sampled data.

  • Daniel Corriveau

    Hello, I have followed the instruction and I keep getting ” an error occured while commincating with the data source”, which is weird considering yesterday I had no issue. Anyone can help?
    Thanks,
    Daniel

    • Dorcas Alexander

      Hi Daniel, I experienced that error last week for several sheets that had no errors previously. All I can tell you is that I tried it again the next day and all the connections worked. It certainly felt like a temporary problem with Google sheets since I didn’t change anything – just kept trying until the error went away.

  • Jacqueline Du Baffour

    Hi Dorcas – hope you are well. Im having issues connecting to google analytics. Please see below some screen shots. How could they be resolved? Thanks

    • Dorcas Alexander

      Hi Jacqueline, If you successfully log in and are asked to allow Tableau to access your GA data (as your first screen shot shows), but then after clicking “Allow” you see a message saying you do not have permission to perform the requested operation (as your second screen shot shows) – this means that the number of GA requests to the API have exceeded the limits and there is a (usually temporary) suspension of API response to those requests. Tableau is attempting to access the Core Reporting API for Google Analytics and these limits are described here: https://developers.google.com/analytics/devguides/reporting/core/v3/limits-quotas?hl=en#discovery

      • Dorcas Alexander

        Usually issues related to sending too many API requests are resolved by waiting and trying again later. The Tableau knowledge base also has some limited advice here: http://kb.tableau.com/articles/issue/error-do-not-have-permission-connecting-to-google-analytics

        • Dorcas Alexander

          You can also double-check to see if the issue is actually about permission. After you sign in to your Google account (not the same as your GA account), Tableau attempts to use your Google account credentials to access GA. If for some reason, the email address you gave Tableau does not match the email address that is in the admin settings in GA, then you need to try signing in again with the address that is in GA. A successful next step will look like the attached image, as Tableau is reading your GA data using the email address you gave.

  • Chris Greer

    Great post Dorcas, thank you! My pet peeve with the connector is that I don’t see a way to bring in the specific destination URLs associated with each unique visitor, unless they are tied to an adwords campaign. I’m currently working with a company that’s not running a significant adwords campaign, so the dimension for URL by adword campaign doesn’t help. Do you know how to do this? They have an enormous number of web pages, so this would be great to figure out the kind of traffic they’re getting to individual pages.

    • Dorcas Alexander

      Hi Chris, I think you probably want the dimension “Landing Page” which is the first page of the user’s session, and can be combined with session-based metrics like “Sessions”, “Goal Completions”, etc. and also attributed to various traffic sources like Organic traffic or Referrals from other sites, in addition to paid sources. Another way to view popular pages is to look at page-based metrics like “Pageviews”, “Average Time on Page” etc. with the dimension “Page” – this approach gives you pages that were viewed at any time during a user’s session.

Contact Us.

LunaMetrics

24 S. 18th Street, Suite 100,
Pittsburgh, PA 15203

Follow Us

1.877.220.LUNA

1.412.381.5500

getinfo@lunametrics.com

Questions?
We'll get back to you
in ONE business day.