Google Tag Manager

Mobi2Go can ensure that Google Tag Manager is loaded on the page.

In order to enable this feature for clients, you'll need to contact us with the tracking ID of the Google Analytics property (a string similar to 'GTM-XXXXXXX').

For those clients that use Google Tag Manager, Mobi2Go can provide tracking of events using Google's Enhanced Ecommerce plugin via the dataLayer.

Using Google Analytics with Google Tag Manager

If you'd also like us to also implement Google Analytics, we'll include Google Tag Manager on the page, but will not use it for event tracking (including Enhanced Ecommerce events), as this will be performed directly by Google Analytics. This means that you can use Google Tag Manager for other tasks, such as script delivery.

However, if you don't want us to include Google Analytics, but still want to track events (including Enhanced Ecommerce events), we'll perform this tracking using the Google Tag Manager dataLayer.

This means that you can do as you wish with the Enhanced Ecommerce events (such as feeding them through to a non-Google service), though you may want still to configure Google Tag Manager to feed the events directly to Google Analytics (i.e. without Google Analytics being included directly on the site), as described in the following articles on Google's website:

The steps outlined in the above articles are detailed more fully below.

Configuring Google analytics to receive Enhanced Ecommerce events

In order to configure Google Analytics to receive Enhanced Ecommerce events, you'll need to set "Enable E-commerce" and "Enable Enhanced E-commerce Reporting" for a particular view.

In order to configure Google Tag Manager to feed ecommerce events to Google Analytics you'll need to do the following in the Google Tag Manager console:

  1. Create a new Variable called, say, GA, and ensure the following properties are set:
    • Variable type: "Google Analytics Setting"
    • Tracking ID: your GA tracking id, in the form "UA-XXXXX-Y"
    • Cookie Domain: "auto"
    • More Settings => Ecommerce: "Enable Enhanced Ecommerce Features" and "Use data layer"



  2. Create a new Tag called, say "Ecommerce", and ensure the following properties are set:
    • Tag Type: "Google Analytics - Universal Analytics"
    • Track Type: "Event"
    • Category: "Ecommerce"
    • Action: "{{Event}}"
    • Non-Interaction Hit: "false"
    • Google Analytics settings: "{{GA}}" (i.e. your variable you created in the previous step)


  3. You'll also need to set up the triggering for the tag. 
    Create a Trigger called, say, "Ecommerce Trigger", and ensure the following properties are set:
    • Trigger Type: "Custom Event"
    • Event Name: "AddToCart|removeFromCart|checkoutPaymentStep1|checkoutPaymentStep2|purchase|detailProduct|impressProducts"
    • "Use regex matching"
    • This trigger fires on: "All Custom Events"


    • Attach the trigger to the "Ecommerce" tag created previously
  4. Optionally, create a tag to capture general events.
    Alongside the enhanced ecommerce events, we provide general events regarding the customer activity, and if you'd also like to capture these to Google Analytics, then proceed as follows.

    Create a new Tag called, say "General", and ensure the following properties are set:
    • Tag Type: "Google Analytics - Universal Analytics"
    • Track Type: "Transaction"
    • Google Analytics settings: "{{GA}}" (i.e. your variable you created previously)


  5. You'll also need to set up the triggering for the tag.

    Create a Trigger called, say, `General Trigger`, and ensure the following properties are set:
    • Trigger Type: "Custom Event"
    • Event Name: "order|menu|location"
    • "Use regex matching"
    • This trigger fires on: "All Custom Events"

Further reading:

Have more questions? Submit a request

Comments