Google Tag Manager enables you to manage tracking scripts for a single or multiple pages via a centralized admin panel.

Tag Manager is in principle intended for specialist professional use

If you'd like to enable Google Analytics via Tag Manager, first disable the Google Analytics extension in your online store.

You may want to enable Google Tag Manager if your online store uses multiple tracking services that should be used in different ways in different versions, for example.

For more information about Google Tag Manager, see our website ›

Pricing

Using the service is free of charge. A paid version of the service is also available. Read more.

Installation and activation

Extensions are not available in MyCashflow Free plan.

First, create a Tag Manager account.

  1. Start by logging into your Google account and creating a new Tag Manager account if you still haven't done so.
  2. Enter your company and container details on the page.

    As the container's usage environment, select Web.

  3. Click Create, and accept the terms and conditions.

    Now you can access Tag Manager's admin panel and the Tag Manager tracking code. Don't do anything about the tracking code.

  4. Copy the Tag Manager container ID (e.g. GTM-K5TV4BV) from the navigation bar.
  5. Back in MyCashflow's admin panel, go to Account > Apps > Google Tag Manager.
  6. In the extension settings, paste the container ID, and save the settings.

    The container ID is specified on a version-specific basis. Tag Manager won't be enabled in a version for which no ID has been specified.

Tag Manager is now enabled, and you can start adding new tracking tags in Tag Manager's admin panel.

For more information about managing tags, see Google's instructions. Below, you can find examples that illustrate how to add some of the most common tracking tags.

Adding tracking scripts via Tag Manager – examples

The examples below illustrate how to add the most common tracking services to your online store by using Google Tag Manager.

If your online store uses multiple tracking scripts, you may want to use Google Tag Manager. Managing and adding scripts is easier by using Google Tag Manager rather than by editing the store theme's HTML files.

Google Analytics

MyCashflow provides a Google Analytics extension, but it is also possible to setup the service via Tag Manager (this is advisable if your online store uses multiple tracking scripts).

To enable Google Analytics:

  • Add the GA tracking ID to the Tag Manager variable
  • Create a tracking tag
  • Add the GA tracking ID to the tracking tag
  • Define a trigger for the tracking tag
  • Enable Enhanced Ecommerce tracking (optional)

Also make sure that MyCashflow's Google Analytics extension isn't enabled in your online store before enabling Analytics via Tag Manager.

See the detailed descriptions below for installation stages:

  1. In Tag Manager's admin tool, open the container you created while enabling Tag Manager.
  2. To create a new variable, go to Variables and click New.

    As the variable type, select Google Analytics settings.

  3. In Google Analytics' admin panel, go to Admin > Tracking Info > Tracking code, and copy the GA tracking ID.

    The tracking ID has the following format: UA-12345678-1.

  4. Back in Tag Manager's admin panel, paste the tracking ID into the settings for the variable you created earlier.
  5. Save the variable.
Your Tag Manager account has now a variable that contains the GA tracking ID. Next, create a new tracking tag and link the ID to it:
  1. In Tag Manager's admin panel, open the Tag Manager container.
  2. To create a new tracking tag, go to Tags and click New.

    As the tag type, select Google Analytics – Universal Analytics.

  3. In the Google Analytics settings field, select the variable containing the GA tracking ID.
  4. Save the tracking tag.
  5. Finally, to define when the tracking tag should send data to Google Analytics, create a trigger for it:

    In the tracking tag's settings, select Triggers > All Pages.

The tracking tag is now ready to use, but it still needs to be published. Before publishing it, you can test it by using Tag Manager's Preview functionality.

Once you're ready to enable the tracking tag in your online store, in the upper right corner, first click Submit and then Publish.

Using separate Google Analytics accounts in different versions

In some cases, you might want to use different Google Analytics accounts in different store versions or disable Analytics in some other versions.

The same process can be applied e.g. to Facebook pixels and other similar tracking services.

  1. For each Google Analytics tracking ID, create a separate variable of the Constant type.

    Enter the Analytics tracking ID as its value.

  2. Make sure that the internal Page Hostname variable is enabled.
Next, you can define terms for using different accounts based on domain:
  1. Create a new variable of the Lookup Table type, and name it e.g. GA_ID.
    • Add a new row to the table for each domain that uses a separate Google Analytics account.
    • Set the variable's input variable to {{Page Hostname}}.
    • As each row's input, specify a domain in the format www.example.com.
    • As each row's output, select one of the Google Analytics variables you created earlier.

Now, the conversion table applies to visitors the correct GA tracking account based on the domain.

Next, add the conversion table to Google Analytics settings, and create a new tracking tag to use with the settings:

  1. Add a new variable of the Google Analytics settings, and name it e.g. GA_SETTINGS.

    As the variable's tracking ID, select the GA_ID conversion table you created earlier.

  2. Create a new tracking tag of the Google Analytics: Universal Analytics type.

    In the tag's Google Analytics settings field, select the GA_SETTINGS variable you created earlier.

Adservice remarketing

This example illustrates how to add Adservice's HTML tracking script to an online store. You can also add many other, common tracking scripts to your online store by following these instructions (e.g. Sanoma's remarketing tags).

  1. In Tag Manager's admin tool, open the container you created while enabling Tag Manager.
  2. To create a new tracking tag, go to Tags and click New.

    As the tag type, select Custom HTML.

  3. In the tag's HTML field, paste Adservice's tracking script.
  4. Select Triggering > All Pages.
  5. Save the tracking tag.

The Adservice tracking script will from now on be loaded onto each page of your online store.

Next you can also add Adservice's conversion tracking to your online store. Tracking is performed only when a customer confirms their order.

Adservice's conversion tracking

This example illustrates how to add the Adservice conversion tracking script for tracking orders that are finalized in your online store.

The example uses Google's data layer variables with which order details are transferred to Adservice (for example, total, order number, currency, etc.).

First, the information required by the tracking service is extracted from Google's data layer into Tag Manager variables:
  1. To create a new variable, go to Variables and click New.

    As the variable type, select Data Layer Variable.

    Enter a name that makes it clear that it is a data layer variable. For example dl – OrderTotal

  2. In the Data Layer Variable Name field, type the name of the data layer variable name (e.g. OrderTotal contains the order total).
  3. Save the variable.

Create separate variables for all details that are required by the tracking service.

After defining the required variables, create a new tracking tag for conversion tracking:

  1. To create a new tracking tag, go to Tags and click New.

    As the tag type, select Custom HTML.

  2. In the tag's HTML field, paste Adservice's tracking script.
  3. Type the data layer variables you've just created in the correct location in the tracking script.

    The variables are added to the script in double curly brackets. E.g. {{dl - OrderTotal}}

  4. Define the trigger for order confirmation page load:
    1. In the tracking tag details, select Triggering > Page View.
    2. Select Some Page Views.
    3. Set the trigger to fire under the following conditions: Page URL > contains > /checkout/thanks.
    4. Save the trigger.
  5. Save the tracking tag.

The tracking tag is now ready to use, but it still needs to be published. Before publishing it, you can test it by using Tag Manager's Preview functionality.

Once you're ready to enable the tracking tag in your online store, in the upper right corner, first click Submit and then Publish.

MyCashflow's data layer

The implementation of the data layer in MyCashflow contains the following details that are sent to Tag Manager during page load:

General and store details

  • Page type (e.g. product, product category, etc.) (CurrentPageType)
    • For search pages, the search term used is sent as well.
  • Page URL (CanonicalUrl)
  • Store address (ShopUrl)
  • Version language (ShopLanguage)

Customer groups

  • Customer email (CustomerEmail)
  • Customer full name (CustomerName)
  • Customer first name and surname (CustomerFirstName, CustomerLastName)
  • Customer company (CustomerCompany)
  • Customer phone number (CustomerPhone)
  • Customer postal code (CustomerZip)
  • Customer city (CustomerCity)
  • Customer country (CustomerCountry)
  • Customer ID (UserId)

Products

  • Product ID (ProductID)
  • Product price (ProductPrice)
  • Product name (ProductName)
  • Product's default product category name (ProductCategoryName)
  • Product lists on which the product is displayed (ecommerce.detail.impressions.list)
    • Product lists are named according to Interface tags used for printing the lists in the store theme.

Shopping cart details

Shopping cart details are available only on checkout pages.

  • Shopping cart's order total (CartTotal)
  • Shopping cart's discounts (CartDiscounts)
  • Shopping cart's shipping costs (CartShippingCosts)
    • Based on the first available shipping method if none selected.
  • Shopping cart's payment fee (CartPaymentCosts)
  • Shopping cart’s product quantity (CartTotalItems)
  • Shopping cart products (ecommerce.products)

Order details

  • Order number (OrderNumber)
  • Order total (OrderTotal)
  • Order tax amount (OrderTax)
  • Order total excluding tax (OrderWithoutTax)
  • Order discounts (OrderDiscount)
  • Order currency (OrderCurrency)
  • Discount coupon used for the order (OrderCouponCode)
  • Order product details (ecommerce.purchase.products)

Banners

Banners include information about the lists they were displayed on.