Google Universal Analytics

Last modified January 7, 2019

This article applies to Contextual Commerce. (Looking for Classic Commerce documentation?)

Setting up Google Analytics and Google Tag Manager in FastSpring

Each Storefront has its own setup for Google Analytics and Google Tag Manager. You can use either Google Tag Manager or Google Analytics separately or both together. If you use both together and your Tag Manager setup contains Google Analytics, you should not set Google Analytics up in FastSpring separately. In the Dashboard, select the Storefronts menu and click SETTINGS for the Storefront you want to edit; then, click the Analytics Integration link on the left-hand side of the Storefront Settings page.

In the Google Tag Manager custom container ID for this storefront field, type your Google Tag Manager Container ID. This should have a format similar to GTM-XXXX.

In the Custom Google Analytics property ID for this storefront field, type the property ID for your Google Analytics account. This should have a format similar to UA-NNNNNN-N. Note: If your Google Tag Manager setup contains Google Analytics, you should skip this field and specify only the Google Tag Manager container.

After you specify the IDs for one or both of these fields, there are additional steps you need to perform in your Google accounts.


If you need to troubleshoot your Google Analytics or Google Tag Manager implementation, the  GA Debugger  extension for the  Google Chrome  Web browser can be a useful tool. This tool, which can be toggled on or off in  Chrome , prints helpful information - such as error messages and warnings - to the JavaScript Console. This may help you identify problems with the way your tracking code has been implemented.

Note about ad blockers

Due to the increasing popularity of ad blocking software / browser add-ins on customers' systems, as many as 10% to 15% of transactions might not be reported to Google Analytics.  This can influence reporting accordingly.  However, ad blockers also directly impact the traffic you see on your website; it will also be underrported by the same amount. Therefore, relative analysis such as conversion rates will not be affected - but absolute numbers of visitors, page views, etc., will be.

As an alternative to browser-based customer interaction tracking, you might consider implementing server-side tracking via Google Measurement Protocol.

Google Analytics

After you have set the Google Analytics property ID in the FastSpring Analytics Settings, it is best to align the time zones used by FastSpring (GMT +0) with the time zone used by your Google Analytics account. Matching time zones makes it easier to compare reports from both sources. To align the time zones, log in to your Google Analytics account, and navigate to Admin > View > View Settings. Choose "United Kingdom" for the Time zone territory. Leave the GMT +00:00 setting as it is.

Next, open Ecommerce Set-up in your Google Analytics Property view. Choose to enable Ecommerce and Enhanced Ecommerce Reporting.

Then, create the following 5 checkout steps:

  1. Payment Option Selected
  2. Name Entered
  3. Email Entered
  4. Payment Data Entered
  5. "Buy Now" Button Clicked

Your Ecommerce setup must look like this:

Click Save. Your Google Analytics account is set up and ready to receive data.

Cross-Domain Tracking Through the Use of the Linker Plugin

You must use the linker plugin from Google in order to ensure that tracking is not lost between your site and FastSpring's store.  There are a couple ways you can implement this on your website, depending upon what kind of Storefront you are linking to.

For Web Storefronts

Important: If you are setting up Google Analytics specifically for use with Google Tag Manager, please skip this section. You will handle the linker separately in your GTM setup.

Include the following lines in the Google Analytics code placed on your website:

Copy and paste the following code to your site:

  ga('require', 'linker');

  ga('linker:autoLink', ['','']);


Replace 'yourcompany' in the above code with your own company id created when you registered with FastSpring
Example of Google Analytics linker plugin code for use on your website
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

  ga('create', 'UA-93623912-1', 'auto');
  ga('require', 'linker');
  ga('linker:autoLink', ['','']);
  ga('send', 'pageview');

When Using Store Builder Library

Important: Only follow these instructions if you are using Store Builder Library (and / or a Popup Storefront). Otherwise, skip this section.

When using the Store Builder Library (including pasting in the code to add a Popup Storefront to your website), include the following decoration attribute in the script that loads the library:

Copy and paste the following into the script that loads your FastSpring Storefront / library:
Example of loading the FastSpring library with the data-decorate attribute included

Then, add the following script to your page, just before the closing </body> tag:

Copy and paste the following code into your page:


    function decorateURL(url) {

                var linkerParam = null;

                ga(function() {

                                var trackers = ga.getAll();

                                linkerParam = trackers[0].get('linkerParam');


                return (linkerParam ? url + '?' + linkerParam : url);



Setting up Referral Exclusions in your Google Analytics account

To prevent issues with tracking being lost when customers are redirected or referred to other domains (e.g. for payment), it is important to set up referral exclusions in your Google Analytics account.

Step-by-step instructions for doing this can be found at

We recommend that you add the following domains to the Referral Exclusion list: