Integrating with Google Analytics for web

Note: this document is for sending Tapstream data to your Google Analytics website tracking dashboard.

For sending Tapstream data to your Google Analytics mobile tracking dashboard, please see the Integrating with Google Analytics for Mobile documentation.

Tapstream Advanced users can send their Tapstream user attribution data to Google Analytics for Web. Tapstream works with Google Analytics to give you one continuous session for a user, from visits to your website through to events they trigger in your app.

Preparing your Tapstream account

Setting up Tapstream to work with your existing Google Analytics account is simple:

  • Set up a custom domain. Only redirectors that use your custom domain will be able to report data to Google Analytics.
  • Log in to Tapstream and click the gear icon, then navigate to your Configuration page.
  • Enable the Google Analytics integration
  • On the same page, add your tracking code. It looks like this: UA-XXXXXXXX-X .
  • Finally, have a look at the Google Analytics JavaScript that's on your site. If you see a line that looks like this: _gaq.push(['_setDomainName', '']);, enter the domain from this line in to the 'Google Analytics tracking domain' field.

Press Save Changes when you're done.

Adding the Google Analytics integration to your account

Installing the Tapstream JavaScript snippet

Generate the Tapstream JavaScript snippet for your account and paste it on your website, between the <head> and </head> tags.

Enabling Google Analytics integration in the JavaScript

To enable Google Analytics integration in the JavaScript, you need to make a small change to it.

Replace this:

_tsq.push(["setAccountName", "your_tapstream_account_name"]);
_tsq.push(["fireHit", "javascript_tracker", []]);

... with this:

_tsq.push(["setAccountName", "your_tapstream_account_name"]);
_tsq.push(["enableGoogleAnalyticsIntegration", true]);
_tsq.push(["fireHit", "javascript_tracker", []]);

Be sure to use the proper account name in the example above.