Collapse Menu
Documentation
FastSpring App
Contact Support

Google Tag Manager

If you are using Google Tag Manager to insert your Google Analytics tracking snippet, do not include your Google Analytics tracking ID in the FastSpring App. This could result in double-counting of events and sales. If you do not want to use Google Tag Manager, follow instructions to integrate Google Analytics.

Google Tag Manager is used to manage snippets, pixels, and scripts on your website. Common examples to use Google Tag Manager include a Facebook or Google Ads conversion pixel or a marketing attribution script such as Marketo or Bizible.

Google Tag Manager can be used together with Google Analytics but is a separate tool. Google Analytics is a platform for collecting website and app data so you can analyze your user experience. You can use Google Tag Manager to inject Google Analytics tracking scripts, but the two can also be used completely separately.

You may need to periodically update your Google Tag Manager settings to stay in compliance with changing browser standards and best practices.

Configuration

You may need to periodically update your Google Tag Manager settings to stay in compliance with changing browser standards and best practices.

  • November 2020: Many browsers have implemented new restrictions on cross-domain tracking and cookie storage, which can have an impact on tools like Google Tag Manager and Google Analytics. To ensure your tracking is functioning properly, we updated the Set Up Google Analytics for the Events Tag instructions below to include a cookieFlags field with the value max-age=2592000;secure;samesite=none.

Prerequisites

  • Create your Google Tag Manager account and copy your Google Tag Manager Container ID.
  • If you are using Google Tag Manager to manage Google Analytics: Follow Google Universal Analytics instructions to configure Google Analytics settings for time zone, ecommerce, and referral exclusions as applicable to your Storefronts. Do not set up Google Analytics integration in the FastSpring App or configure cross-domain tracking.

Integration for all Storefronts

To set up Google Tag Manager integration for all storefronts:

  1. In the FastSpring App, navigate to Integrations > Extensions > Google Tag Manager.
  2. Click Setup.
  3. Enter your Google Tag Manager Container ID and click Enable.

Custom Integration for Individual Storefronts

Only configure custom Google Tag Manager integration for individual Storefronts if you need to use different IDs for different Storefronts. Otherwise, configure Google Tag Manager integration for all Storefronts following the steps above.

  1. In the FastSpring App, navigate to Storefront you want to modify and click Settings.
  2. Within the Storefront Settings, click Analytics Integration in the left menu.
  3. In the Google Tag Manager Integration Behavior drop-down, select Use custom Google Tag Manager container ID for this storefront.
  4. Enter your Google Analytics Tracking ID in the Google Tag Manager > Google Tag Manager custom container ID for this storefront field and click Save at the top right-hand corner of the page.

Set Up Variables

Create user-defined variables:

  1. Enter 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 and choose Data Layer Version 2.
  4. Click Save.
  5. 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

Set Up Google Analytics for the Events Tag

Add a Google Universal Analytics tag.

  1. Click Tags > New.
  2. Enter Events as the tag name.
  3. Select Tag Configuration > Google Analytics: Universal Analytics.
  4. Select Event for Track Type.
  5. Enter the following values in the Event Tracking Parameter fields:
    • Category: {{fsc-eventCategory}}
    • Action: {{fsc-eventAction}}
    • Label: {{fsc-eventLabel}}
    • Value: {{fsc-eventValue}}
    • Non-Interaction Hit: False
  6. Select False for Non-Interaction Hit.
  7. In the Google Analytics Settings drop-down, select New Variable
  8. Enter your Property Name and Tracking ID (from your Google Analytics account).
  9. Expand More Settings > Ecommerce and
  10. Select the checkbox for Enable Enhanced Ecommerce Features and Use data layer.
  11. Expand Fields to Set and add the following fields:
    • cookieFlags: max-age=2592000;secure;samesite=none
    • allowLinker: true
    • location: {{fsc-url}}
    • referrer: {{fsc-referrer}}
    • storage: none
    • forceSSL: true
  12. Click Save.
  13. Click within the Triggering area and select New trigger (the plus sign in the top right corner).
  14. Enter the name FastSpring Events.
  15. Click within the Trigger Configuration area and select Other > Custom Event.
  16. Enter .* in the Event name field and select the checkbox for Use regex matching.
  17. Select the radio button for Some Custom Events and then select Event, starts with, and enter FSC-.
  18. Click Save > Save.

Set Up Google Analytics for the Pageview Tag

  1. Click Tags > New.
  2. Enter Pageview as the tag name.
  3. Select Tag Configuration > Google Analytics: Universal Analytics.
  4. Select Page View for Track Type.
  5. In the Google Analytics Settings drop-down, select your Google Analytics variable configured in the previous section.
  6. Click within the Triggering area and select New trigger (the plus sign in the top right corner).
  7. Enter the name fsc-url and click within the Trigger Configuration area.
  8. Select Page View > Page View and select the radio button for Some Page Views.
  9. Select fsc-url, starts with, and enter h.
  10. Click Save > Save.

Trigger a Tag on the Order Completion Page

You can optionally trigger 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:

Add Custom Tags to Google Tag Manager

In addition to the variables listed above, FastSpring populates the Data Layer with additional data that is useful for various custom tags that you can add to the container.

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. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • 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.

“FSC-checkoutStep2” event

This event fires when a customer enters a name in the payment details. No identifiable customer data is passed.This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • fsc-eventCategory – “Checkout”
  • fsc-eventAction – “Name Entered”

“FSC-checkoutStep3” event

This event fires when a customer enters an email address in the payment details window. No actual customer data is passed. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • 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

“FSC-checkoutStep4” event

This event fires when a customer enters payment details in the payment window. No actual customer data is passed. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • fsc-eventCategory – “Checkout”
  • fsc-eventAction – “Payment Data Entered”

“FSC-checkoutStep5” event

This event fires when a customer clicks the “Buy Now” button in the payment window. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • fsc-eventCategory – “Checkout”
  • fsc-eventAction – “Payment Started”

“FSC-purchaseComplete” event

This event fires when a customer completes the purchase. This event does not contain ecommerce data becasue ecommerce data is passed with the pageview.

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

“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. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • 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).

“FSC-itemRemovedFromCart” event

This event fires when a customer removes an item from the cart. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • fsc-eventCategory – “Checkout”
  • fsc-eventAction – “Item removed from cart”

“FSC-detailedItemView” event

This event fires when a customer clicks to see detailed information about an item. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

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

“FSC-promotionView” event

This event fires automatically when related offers are loaded on the page, such as cross-sells, upsells, and product options. For Google Analytics Ecommerce Tracking, related offers are labeled as promotions. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report.

  • fsc-eventCategory – “Related Offers”
  • fsc-eventAction – “Related Offers Available”

“FSC-promotionClick” event

This event fires when a customer clicks on a related offer such as cross-sells, upsells, and product options. For Google Analytics Ecommerce Tracking, related offers are labeled as promotions. This event also contains Ecommerce data for the Google Analytics Enhanced Ecommerce report.

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

Pageview

To comply with Google Tag Manager, pageviews fire without an explicit event field value. This event also contains ecommerce data for the Google Analytics Enhanced Ecommerce report. Purchase completion is 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