Google Tag Manager

Last modified August 2, 2017

After you have set the Google Tag Manager container in the Analytics Settings, there are configuration steps that need to be performed in your Google Tag Manager account: Here is a quick list of the steps that are described in more detail below:

  1. Set up Variables.
  2. Set up an Events tag.
  3. Set up a Pageviews tag.
  4. Set up Referral Exclusions in your Google Analytics account.
     

Tip

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.


Setting up variables

Navigate to the Variables section. Click New.

  1. Type fsc-url as the Variable Name.
  2. Choose Data Layer Variable as the Variable Type
  3. Type fsc-url as the Data Layer Variable Name.
  4. Click Save Variable.

Repeat the steps above for the following variables:

  • fsc-url
  • fsc-referrer
  • fsc-eventAction
  • fsc-eventCategory
  • fsc-eventLabel
  • fsc-eventValue
  • fsc-currency
  • fsc-order-id – Contains the FastSpring order reference ID
  • fsc-order-tax – Contains the tax amount for this order
  • fsc-order-total – Contains the order total
  • fsc-coupon – Contains order coupon

Setting up Google Analytics for the Events tag

  1. Add a Google Universal Analytics tag.
  2. Type any tag name you want. We suggest adding "Events" to the name for easier reference. 
  3. Enter your Google Analytics property ID. (Make sure that the Google Analytics account has Enhanced Ecommerce enabled as described above.)
  4. Choose Event for the "Track Type".
  5. Type values in the Event Tracking Parameter fields as shown below:

6. Expand More Settings.

7. Expand Ecommerce Features.

a. Check the box next to Enable Enhanced Ecommerce Features.

b. Check the box next to Use data layer. Your setup should now look like this:

8. Expand Fields to Set and add the four fields shown below:

9. Go to Triggers > New.

11. Choose {{event}} starts with FSC-. Your setup should now look like this:

12. Click Save to save the trigger. 

Setting up Google Analytics for the Pageview tag

  1. Add a Google Universal Analytics tag.
  2. Type any tag name you want. We suggest adding "Pageview" to the name for easier reference. 
  3. Enter your Google Analytics property ID. (Make sure that the Google Analytics account has Enhanced Ecommerce enabled as described above.)
  4. Choose Pageview for the "Track Type".
  5. Expand More Settings.
  6. Expand Fields to Set, and add the fields shown below:



  7. Expand Ecommerce Features.
  8. Check the box next to Enable Enhanced Ecommerce Features.
  9. Check the box next to Use data layer. Your setup should now look like this:


     
  10. Adjust trigger to fire tag when value of the macros {{fsc-url}} begins with "h". This will ensure that the rule is only fired when fsc-url is present and is not empty.
  11. Click Save to save your container.

Firing a tag on the order completion page

If you would like to fire tags on the order completion page (and have access to all the order-related variables) you can add a Trigger to only fire on the order completion page:

Adding custom tags to Google Tag Manager

After the required setup is done, you can add more tags to this container. In addition to already described variables, FastSpring populates the "Data Layer" with additional data that is useful for various custom tags.

Each event has the following variables and values, in addition to the variables listed for the specific event:

fsc-url – The URL of the page where events are happening (cart page). Since  GTM tags are sandboxed within FastSpringyou will not be otherwise able to obtain this parameter. 
fsc-referrer – The URL of the page referring to the cart page. 
fsc-currency – 3-letter currency code.

"FSC-checkoutStep1" event

This event is fired when a customer starts the payment process by clicking "Place your order".

fsc-eventCategory – "Checkout"
fsc-eventAction – "Payment Method Selected"
fsc-eventLabel – Contains the selected payment method. This is "card" for credit cards, "paypal" for PayPal, "wire" for bank wire transfer, and so on.

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-checkoutStep2" event

This event is fired when a customer enters the name in the payment details. No identifiable customer data is passed.

fsc-eventCategory – "Checkout"
fsc-eventAction – "Name Entered"

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-checkoutStep3" event

This event is fired when a customer enters an email address in the payment details window. No actual customer data is passed.

fsc-eventCategory – "Checkout"
fsc-eventAction – "Email Entered (Payment Window)" when an email address is entered in the Payment Window
fsc-eventAction – "Email Entered (Homepage)" when an email address is entered on the homepage

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-checkoutStep4" event

This event is fired when a customer enters payment details in the payment window. No actual customer data is passed. 

fsc-eventCategory – "Checkout"
fsc-eventAction – "Payment Data Entered"

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-checkoutStep5" event

This event is fired when a customer clicks the "Buy Now" button in the payment window.

fsc-eventCategory – "Checkout"
fsc-eventAction – "Payment Started"

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-purchaseComplete" event

This event is fired when a customer completes the purchase. 

fsc-eventCategory – "Checkout"
fsc-eventAction – "Purchase Complete"
fsc-eventLabel – "Total Order Value"
fsc-eventValue – Contains the order total 

This event does NOT contain Ecommerce data; ecommerce data is passed with the pageview. 

"FSC-itemAddedToCart" event

This event is fired when any item is added to the cart. It is not fired for items that are already in the cart when the page is loaded. For example, items in the cart on a product page does not trigger this event, but new items the customer adds will trigger it. 

fsc-eventCategory – "Checkout"
fsc-eventAction – "Item Added to Cart"
fsc-eventLabel – "Price"
fsc-eventValue – Contains the total price of the item added to cart (unit price * quantity - discounts).

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-itemRemovedFromCart" event

This event is fired when a customer removes any item from the cart. 

fsc-eventCategory – "Checkout"
fsc-eventAction – "Item removed from cart"

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-detailedItemView" event

This event is fired when a customer clicks to see detailed information about an item. 

fsc-eventCategory – "Checkout"
fsc-eventAction – "Item details viewed"
fsc-eventLabel – Contains the product path of the clicked item.

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-promotionView" event

This event is fired automatically when related offers are loaded on the page. Related items are Cross-sells, Up-sells and Options. For Google Analytics Ecommerce Tracking those items are considered as "promotions". 

fsc-eventCategory – "Related Offers"
fsc-eventAction – "Related Offers Available"

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

"FSC-promotionClick" event

This event is fired when customer clicks on any "related offer". Related items are Cross-sells, Up-sells and Options. For Google Analytics Ecommerce Tracking, those items are considered "promotions". 

fsc-eventCategory – "Related Offers"
fsc-eventAction – "Related Offer Clicked"
fsc-eventLabel – Contains the product path of the clicked item.

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report. 

Pageview

To comply with the way Google Tag Manager works, pageviews are fired without an explicit "event" field value.

Purchase completion is also fired as a Pageview, but contains these additional fields:

fsc-eventCategory – "Checkout"
fsc-eventAction – "Purchase Complete"
fsc-eventLabel – "Total Order Value"
fsc-eventValue – Contains the order total
fsc-order-id – Contains the FastSpring order reference ID
fsc-order-tax – Contains the tax amount for this order
fsc-order-total – Contains the order total
fsc-coupon – Contains order coupon

This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report.

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: