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.
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.
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:
- Payment Option Selected
- Name Entered
- Email Entered
- Payment Data Entered
- "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
Include the following lines in the Google Analytics code placed on your website:
When Using Store Builder Library
Then, add the following script to your page, just before the closing </body> tag:
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 https://support.google.com/analytics/answer/2795830?hl=en.
We recommend that you add the following domains to the Referral Exclusion list:
- <storename>.onfastspring.com (where <storename> is the name of your Storefront, e.g. furiousfalcon.onfastspring.com)