Adventures in Marketing: Google Analytics via Alteryx

Connecting to Google Analytics in Alteryx offers amazing Automation for Marketers.

Install the Google Analytics Tool

The bad news is that getting Google Analytics set up in Alteryx is a labyrinthian process, particularly getting the API Key set up. But once there, you'll find yourself in a very happy and highly automated place.  To start, you'll want to download the correct version of the tool here.  That's the easy part, although even that is fraught with peril, as figure 1 shows.

you need a Google API Key!

Next, to get yourself a Google Analytics (and hopefully Sheets) API key, you'll need to travel through the seventh circle of hell.  TaraM has a very helpful blog to guide posted here, though if you're a Seagate employee, reach out to me directly, as I have a customized version of the guide due to some internal restrictions affecting the process.  In preview, there's at least 17 oft-changing steps to check out a Google API Key, but once you're through it, you'll have three important credential components: client id, client secret, refresh token.  

The credentials then allow you to log in more or less permanently via server to create automated connections using a static version of your account credentials to pull Google Analytics (or Google Sheets) data via Alteryx Designer or Alteryx Server.

Awesome, now what?!!  Well, assuming your Google Account has access to a provisioned Google Analytics Accounts and their associated WebProperties, you should see there are about 5 pages worth of configuration settings to work through in the Alteryx Google Analytics Tool.  Successfully configured, you'll be able to automate those results and schedule your reporting of Google Analytics Data!

nastygram.png
A quick note of warning: Once operational, you will likely soon find a nasty-gram in your inbox from Google.  It'll say that you've exceeded your daily quota, been sent a (Not Modified) response code, or your usage hit various rate limits. You might consider caching your results in a YXDB and developing the rest of your workflow based on that data; be sure to only pull exactly the data you need for your viz; and lastly be aware that there are some tools for adjusting the timing of actions in a workflow, but for now these are all beyond the scope of this article.  

Tip: USe built-in INdexing Of Time for Easy Trending

Back to the data at hand, I'll plug "nthWeek", "nthMonth", etc, because these dimensions dynamically allow you to sort time periods like months chronologically in Tableau, regardless of how those fields would sort alphabetically or numerically.  You can also use them to filter out particular months, like an in-period that isn't yet complete.

I personally like to cast the month periods as "short months" (e.g. 01 -> "Jan", etc) using the switch() function in a Formula tool to parse out the numeric month values into written shorthand.  

 

 

Then, in Tableau, I'll put [Mon] in the column shelf and sort it by the Average of NthMonth, which arranges the months into chronological order!

The end result is a super clean look that can scale down to a small size without compromising readability.