Collapse Menu
Docs Home
Extensibility Options
Contact Support

Google Tag Manager

Overview

This article provides information about Google Tag Manager

 Important

Before setting up Google Tag Manager, please follow the instructions in our article Google Universal Analyticsexcept for the section titled For Web Storefronts. Return to this article to configure GTM once you have completed the remaining applicable steps in the Google Universal Analytics article.

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

 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 information may help you identify problems with your tracking code implementation.

 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 issue can influence reporting accordingly. However, ad blockers also directly impact the traffic you see on your website; it is also under-reported by the same amount. Therefore, relative analysis, such as conversion rates, is not affected - but it can affect things like the count of visitors or page views.

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.
    1. Check the box next to Enable Enhanced Ecommerce Features.
    2. Check the box next to Use data layer. Your setup should now look like this:


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


     
  9. Go to Triggers > New.
  10. Choose {{event}} starts with FSC-. Your setup should now look like this:


     
  11. 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 the value of the macros {{fsc-url}} begins with "h". Doing this ensures that the rule only fires when fsc-url is present and is not empty.
  11. Click Save to save your container.

 

Firing a Tag on the Order Completion Page

You can optionally fire tags on the order completion page. If you have access to all the order-related variables, you can add a Trigger that only fires on the order completion page:

 

Adding Custom Tags to Google Tag Manager

After you have completed the required setup, you can add more tags to this container. In addition to the 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 FastSpring, you cannot obtain this parameter otherwise. 

fsc-referrer – The URL of the page referring to the cart page. 

fsc-currency – 3-letter currency code.

"FSC-checkoutStep1" event

This event fires 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. For example, the value may be "card" for credit cards, "paypal" for PayPal, or "wire" for bank wire transfers.

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

"FSC-checkoutStep2" event

This event fires 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 fires 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 a customer enters an email address in the Payment Window

fsc-eventAction – "Email Entered (Homepage)" when a customer enters an email address on the homepage

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

"FSC-checkoutStep4" event

This event fires 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 fires 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 fires 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 fires when a customer adds an item to the cart. It does not fire for items that are already in the cart when the page loads. For example, items in the cart on a product page do not trigger this event, but adding new items does 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 the cart (unit price * quantity - discounts).

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

"FSC-itemRemovedFromCart" event

This event fires when a customer removes an 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 fires 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 fires automatically when related offers are loaded on the page. Related items are cross-sells, upsells, and product 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 fires when a customer clicks on a "related offer." Related items are cross-sells, upsells, and product 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 fire 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.

Try FastSpring

Get a free account and see why FastSpring is the ecommerce partner of choice for software providers around the world. Try our full-service ecommerce solution today to unlock revenue growth for your online company.