fbpx

Adding Google Analytics to your Tableau Server

If you're a Tableau Server administrator or Publisher of content to Tableau Server then you probably at some point wondered how popular your dashboards and views are. Tableau fortunately has a simple answer to that with their Server Admin views however, if you've ever wanted to know more about how your users are using your views, this post is for you.

Google fortunately offers an incredible service for free that helps us tracking many of the areas of interest called Google Analytics. You can sign up for free here: www.google.com/analytics/

Ignore the pie charts they display and go sign up for an account if you haven't already.

Once you've setup your Google Analytics account you'll need to add some javascript code to your Tableau Server pages to get this going. Before I show you how to do this I must warn you, this is modifying the source code of Tableau Server and if you call support they may be unhappy and not help you unless you revert back to the original code base. Okay, with that said, here we go:

You'll need system admin rights on the Windows Server hosting Tableau itself.

  1.  Navigate to the following location on your Tableau Server:

C:Program Files (x86)TableauTableau Server7.0wgserverz5WEB-INFappviewslayouts

  1. Make a copy of all the files in that directory and put them in a safe place (eg. source control, DropBox, etc.)
  2. Open each file, and before the last closing </body> tag add your javascript from Google Analytics. It should look something like this:

<!– Adding Google Analytics script     Ben Sullins    2013-Jan-2    –>

<script type=”text/javascript”>

var _gaq = _gaq || [];
var pluginUrl = ‘//www.google-analytics.com/plugins/ga/inpage_linkid.js';
_gaq.push([‘_require', ‘inpage_linkid', pluginUrl]);
_gaq.push([‘_setAccount', ‘UA-########-#‘]);
_gaq.push([‘_setDomainName', ‘mydomain.com‘]);
_gaq.push([‘_trackPageview']);

(function() {
var ga = document.createElement(‘script'); ga.type = ‘text/javascript'; ga.async = true;
ga.src = (‘https:' == document.location.protocol ? ‘https://ssl' : ‘http://www') + ‘.google-analytics.com/ga.js';
var s = document.getElementsByTagName(‘script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>

  1. Notice I added an HTML comment in there as a reference. Make sure to do something similar to that as well.
  2. Restart the Tableau Service however you like, I prefer doing “tabcmd stop” and then “tabcmd start” from the command line.
  3. Go to your Google Analytics account and test that Google recognizes your setup as being installed.

From here you can go and build custom dashboards in Google Analytics or just use the standard reporting. Another neat feature is the real-time tracking. Here are some screenshots of mine which has been running for a week on a test environment. Click on the thumbnail for the full-size image.

Hope you enjoyed this! Cheers!

 

Visitor Flow: See how users navigate through your Tableau Server with this view

Visitor Flow

 

Standard Reporting – Audience Overview: High-level view of your Tableau Server utilization

Audience Overview

 

Real-Time Analytics: Use this to see current users on the Tableau Server

Real-Time Analytics

 

In-Page Analytics: See where users are clicking and the browser sizes. Unfortunately this does not work inside dashboards/views.

In-Page Analytics

 

Custom Dashboards: Hate pie charts as much as I do? Get rid of them in the standard Google Analytics dashboards and replace them with your own versions.

Custom Dashboard

6 Comments

  1. Excellent! Works like a charm, but I could not find the file to edit in
    order to make this work in an embeded view. Seems like Tableau Server
    uses another template for this.

    Do you know which file needs to be edited for the embedded view?

  2. Sten: Did you ever learn what file needs to be edited for the embedded view?

  3. No, I never found out which file to edit…so I had to do some workarounds using html and embedding to track users. This was on Version 8.2. I have not looked for it on 9.0.

  4. We use a Tableau server that is shared across groups, each with its own Site and projects underneath. Each group similarly has its own GA account. Is it possible to make this change in the context of specific Sites on the server? Or is it a server-wide “thing”?

  5. hey Ben, do you know if Tableau has released anything official to monitor traffic hitting the server ie, screen resolution of the user, smartphone/tablet/desktop access? we are in a spot where we cannot install external Javascripts to our Tableau server deployment and having to go to a google analytics to be able to monitor the server usage stats-

Comments are closed.