> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/analytics/analytics/implement-google-universal-analytics-in-convertplus-and-inline-checkout-with-gtm.md).

# Implement Google Universal Analytics in ConvertPlus and InLine Checkout (with GTM)

## Overview

***

You can implement Google Universal Analytics and Google Tag Manager tracking tools to help you track and monitor your ConvertPlus and InLine checkout orders to improve the shopping experience and increase the conversion rate.

{% hint style="warning" %}

#### Important!

This documentation refers to Google Universal Analytics, which is a deprecated version that will be sunset starting July 1st 2023 for free Universal Analytics properties and starting July 1st 2024 for 360 Universal Analytics properties. **We strongly recommend you to migrate as soon as possible to** [Google Analytics 4](https://docs.2checkout.com/analytics/analytics/implement-google-analytics-4-in-convertplus-and-inline-checkout-with-gtm.md) **using the data layer that we have on GA4 format**.
{% endhint %}

## Availability

***

Google Universal Analytics and Google Tag Manager can be set for all 2Checkout accounts.

## Google Universal Analytics Settings

***

### Implement Google Universal Analytics

To implement Google Universal Analytics through Google Tag Manager (GTM) for your ConvertPlus and InLine Checkout, follow these steps:

1. In your browser window, navigate to **Tag manager** → [All accounts](https://tagmanager.google.com/#/home).

2. Click the **Create Account** button.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/2vN4iHzJrhb0dKPxLyg6/Google%2Banalytics%2Bvia%2BGTM_1.png)

3. Fill in all the required fields:
   * Account Name
   * Country
   * Container name
   * Target platform → Web

4. Click the **Create** button.

5. Copy the Google Tag Manager Container ID. It will be used in the 2Checkout Merchant Control Panel for the Google Tag Manager [set-up](https://secure.2checkout.com/cpanel/web_analytics.php).<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/BrBjsBtMOUssB2cT5kiv/Google%2Banalytics%2Bvia%2BGTM_2.png)

## Create a Google Universal Analytics Settings variable in Google Tag Manager

***

If you already have a Google Universal Analytics Settings variable with your Google Universal Analytics Tracking ID, skip to the next section. If not, create one:

{% stepper %}
{% step %}

#### Create the Universal Analytics Settings variable

In your Google Tag Manager account, navigate to **Variables** → U**ser-Defined Variables** → **New**.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/f1JAkNrx9ibHW5cqCrCz/Google%2Banalytics%2Bvia%2BGTM_3.png)

From the list provided by Google, select the **Google Universal Analytics Settings** option as *Variable Type*. Name your variable “Google Analytics Settings”.

Under *Tracking ID* add the Google Universal Analytics Tracking ID to which you wish to send data.

To get your Google Universal Analytics Tracking ID, navigate to **Google Universal Analytics** → **Admin** → **Tracking Info** → **Tracking Code**. You will find the code under *Tracking ID*. Copy and add it to your variable.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/FKvYwa6LB0m4rAYYo64R/google%2Banalytics%2Btracking%2Bid.png)
{% endstep %}

{% step %}

#### Configure cross-domain tracking & cookie flags

For cross-domain tracking between your website and the 2Checkout shopping cart, configure cross-domain settings in the *Google Universal Analytics* variable so Google counts a shopper coming from your website to the 2Checkout shopping cart as the same visitor.

* Go to **More Settings** → **Cross Domain Tracking** and type the following domains (comma-separated) into *Auto Link Domains*: secure.2checkout.com,tracking.avangate.net

Append flags to the Google Universal Analytics cookie with “secure” and “samesite=none”:

* In the *Google Universal Analytics Settings* variable, click on **Fields to set**.
* Add a new field:
  * **Field Name**: cookieFlags
  * **Value**: samesite=none secure
* Click **Save**.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/9tEyvYdazEvFO9C4qEGO/google%2Banalytics%2Bwith%2BGTM_step6_new.png)
{% endstep %}
{% endstepper %}

## Create the trigger for the Google Universal Analytics Convert Plus Tag

***

In Google Tag Manager, create triggers to capture Convert Plus and InLine shopping cart events. You should create two triggers: one for non-interactive events (checkout and purchase) and one for interactive events (`addToCart` and `removeFromCart`).

{% stepper %}
{% step %}

### Create the non-interactive event trigger

1. In Google Tag Manager, click **Triggers** and add a new trigger.
2. Name your trigger Event Ecommerce Non-interactive.
3. Choose **Custom event** as *Trigger Type*.
4. In *Event name* type .\* and check **Use RegEx matching**.
5. For *This trigger fires on* select **Some custom events**.
6. **Rule**: Event matches RegEx (Ignore case) checkout|purchase
7. Click **Save**.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/t4r851lp7OImvahq2fij/Google%2Banalytics%2Bvia%2BGTM_6.png)
{% endstep %}

{% step %}

### Create the interactive event trigger

1. Add another trigger and name it Event Ecommerce Interactive.
2. Choose **Custom event** as *Trigger Type*.
3. In *Event name* type .\* and check **Use RegEx matching**.
4. For *This trigger fires on* select **Some custom events**.
5. **Rule**: Event matches RegEx (Ignore case) addToCart|removeFromCart
6. Click **Save**.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/sLYYBIu1dgZ9XtASenKl/trigger%2Bconfiguration.jpg)
{% endstep %}
{% endstepper %}

## Create the tag for ConvertPlus eCommerce tracking in Google Tag Manager

***

You will create two tags: one for non-interactive events (checkout and purchase) and one for interactive events (`addToCart/removeFromCart`).

{% stepper %}
{% step %}

### Create the tag for Non-interactive events

1. In Google Tag Manager, click **New Tag**.
2. Name your tag: Google Analytics Convert Plus – Event Type Non-Interactive.
3. Select **Google Analytics: Universal Analytics** as *Tag Type*.
4. For *Track Type*, select **Event**.
5. For *Category type* select **Ecommerce**.
6. For *Action* select **Event from the list**.
7. In *Non-Interaction Hit* select **True**.
8. In *Google Universal Analytics Settings* select your Google Universal Analytics Settings variable.
9. Check **Enable overriding settings in this tag**.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/0TuKB0k1HcitM5Ansejk/Google%2Banalytics%2Bvia%2BGTM_9.png)

10. Under *More Settings* → *Ecommerce* → *Enable Enhanced Ecommerce Features* select **True**.
11. Check **Use Data Layer** to capture eCommerce information from the data layer provided by 2Checkout.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/WoXjWVq0riqklj89DLb7/Google%2Banalytics%2Bvia%2BGTM_10.png)

12. In *Triggering*, select the **Event Ecommerce Non-interactive** trigger.&#x20;

<figure><img src="https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/Yvt4ud2K4E1nUnEy1KDy/Google%2Banalytics%2Bvia%2BGTM_11.png" alt=""><figcaption></figcaption></figure>

13. Click **Save**.
    {% endstep %}

{% step %}

### Create the tag for Interactive events

1. Click **New Tag**.
2. Name your tag: Google Analytics Convert Plus – Event Type Interactive.
3. Select **Google Analytics: Universal Analytics** as *Tag Type*.
4. For *Track Type* select **Event**.
5. For *Category type* select **Ecommerce**.
6. For *Action* select **Event from the list**.
7. In *Non-Interaction Hit* select **False**.
8. In **Google Universal Analytics Settings** select your Google Universal Analytics Settings variable.
9. Check **Enable overriding settings in this tag**.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/T2RuwQ3yJl1dc4rAd0K4/Google%2Banalytics%2Bvia%2BGTM_12.png)

10. Under *More Settings* → *Ecommerce* → *Enable Enhanced Ecommerce Features* select **True**.
11. Check **Use Data Layer** to capture eCommerce information from the data layer provided by 2Checkout.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/tHANrO5GXAIiaZHmyrku/Google%2Banalytics%2Bvia%2BGTM_13.png)

12. In *Triggering*, select the **Event Ecommerce Interactive** trigger.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/WRBWGW5hPUr1wnjFjW2U/Event%2BEcommerce%2BInteractive.JPG)

13. Click **Save**.
    {% endstep %}
    {% endstepper %}

## Enable Enhanced Ecommerce in your Google Universal Analytics account

***

1. In *Google Universal Analytics* go to **Admin** → **View Settings** → **Ecommerce settings**.
2. Make sure **Enable Ecommerce** & **Enable Enhanced Ecommerce Reporting** are both ON.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/YLOSkjuUeaG70dZcrO8l/Google%2Banalytics%2Bvia%2BGTM_15.png)

{% hint style="info" %}
This information applies to Google Universal Analytics without GTM as well.
{% endhint %}

## Exclude the 2Checkout domains from the referral list

***

To exclude the 2Checkout domains from the referral list in your Google Universal Analytics account:

1. Go to **Admin** → **Property settings** → **Tracking info** → **Referral Exclusion List**.
2. Add your website’s domain and the following 2Checkout domains:
   * secure.2checkout.com
   * tracking.avangate.net

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/a87iEWxbmPmufaWEhMpj/Google%2Banalytics%2Bvia%2BGTM_16.png)

{% hint style="info" %}
This information applies to Google Universal Analytics without GTM as well.
{% endhint %}

## Test your Google Universal Analytics Settings

***

To test if your Google Universal Analytics settings are correct (do not use Incognito mode):

1. Download and install the Tag Assistant Companion browser extension from: <https://chrome.google.com/webstore/detail/tag-assistant-companion/jmekfmbnaedfebfnmakmokmlfpblbfdm>.

2. In *Google Tag Manager* click **Preview**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/peA1l5XhG0wnVMfltFBq/preview%2BGTM.png)

3. Delete all existing domains in the preview configuration.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/VKC79mrDa9hY7DPNNQam/delete%2Ball%2Bdomains.png)

4. Click **Add domain**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/wBh1lHfpG9MxIpf02HnL/add%2Bdomain.png)

5. Add <https://tracking.avangate.net/> and click **Start**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/1FsehAPLpnChUg8IJ8Yv/click%2Bstart.png)

6. Go back to the Google Tag Manager tab but don’t close the tab with tracking.avangate.local.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/LeU1TGbHWuzMqjLyzeji/tracking%2BURL.png)

7. Click the X in the top-left corner of the preview pane.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/wSPwOXp9IWnvSb0iD3yz/connecting%2Bto%2Bavangate.png)

8. In the *Tag Assistant* tab, click **Add domain**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/LHpvcq0a8myT1odiZ3h9/add%2Bdomain%2Btag%2Bassisstant%2Btab.png)

9. Enter the buy-link you want to debug and click **Start**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/mbBphJPQKLFdAdQ0HU1A/debug%2Bbuy%20link.png)

10. Go back to the *Google Tag Manager debugger* tab.<br>

    ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/Qp1EMjTcQ5E6uHNmkbG5/debugger.png)

11. Click **Enable** behind the *Connecting this window to avangate.net* pop-up.<br>

    ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/GhEE1MBOJt8UXVxlCWiQ/enable%2Bpopup.png)

12. Click **Continue**.<br>

    ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/TWIDfroeWvbkpDDhZQbu/click%2Bcontinue.png)

You are now debugging tracking.avangate.net, which receives tags from the shopping cart.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/OMDGXmfPTECnipkPoeEN/debug%2Bsuccess.png)

Submit and publish your settings.

![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/zLDGwwWGvEz3ZkR2rdw9/Google%2Banalytics%2Bvia%2BGTM_20.png)

## Merchant Control Panel Settings

***

The Analytics section in your Merchant Control Panel allows you to integrate Google Universal Analytics and/or Google Tag Manager in the ConvertPlus or InLine ordering engines and track shopper behavior on 2Checkout pages.

1. Log in to your [Merchant Control Panel](https://secure.2checkout.com/cpanel).

2. Navigate to **Setup** → **Ordering options**.

3. Click on the **Analytics** tab.

4. Click on the **ConvertPlus and InLine Checkout** tab.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/CkdSEiPnILTdms1UJV5G/web%2Banalytics%2Bin%2BMerchant%2BControl%2BPanel_5.png)

5. In the *Google Tag Manager* box, click **Set up**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/te9dW31U2G70ELONRYMq/MicrosoftTeams%20image%20\(163\).png)

6. Fill in the Google Tag Manager code (Here is how you obtain it) and click **Save**.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/ODXP33GOGuqmEthQoXo7/MicrosoftTeams%20image%20\(164\).png)

7. Use the slider to activate Google Tag Manager. \
   \
   It is not recommended to activate both Universal Analytics and Google Tag Manager to send data to the same Google Universal Analytics view, otherwise duplicate data will occur.<br>

   ![](https://content.gitbook.com/content/dnV9OOb1DpgpbHZ17v2Y/blobs/CtahYriptzFoaZAr994p/MicrosoftTeams%20image%20\(162\).png)

{% hint style="info" %}

* 2Checkout data layer for tracking through Google Tag Manager is placed in an iFrame. This data layer has an eCommerce object that contains eCommerce information built on the structure required by Google Universal Analytics reporting for the following events: checkout, add to cart, product impressions (for cross-sells), purchase, and remove from cart.
* For fully enhanced eCommerce reporting in Google Universal Analytics, it is recommended that you send information to Google Universal Analytics from your website that includes product impression, product detail, and add to cart. More information on enhanced eCommerce reporting and how to send Product View and Add to Cart data to Google Universal Analytics can be found [here](https://developers.google.com/tag-manager/enhanced-ecommerce).
* In addition to the `eCommerce` object, the data layer also contains an event called `cartUpdated` that includes additional parameters with information on the shopping cart. These parameters can be used to capture further information in custom dimensions. Refer to the [Google Documentation](https://support.google.com/tagmanager/answer/6164990?hl=en) on how to build custom dimensions through Google Tag Manager.
  {% endhint %}

#### <i class="fa-books">:books:</i> Related documentation

* [Implement Google Universal Analytics in ConvertPlus and InLine Checkout (without GTM)](https://docs.2checkout.com/analytics/analytics/implement-google-universal-analytics-in-convertplus-and-inline-checkout-without-gtm.md)
* [Google Tag Manager Code Integration for Default Flows – Google Analytics 4](https://docs.2checkout.com/analytics/analytics/google-tag-manager-code-integration-for-default-flows-google-analytics-4.md)
* [Tracking capabilities in ConvertPlus and InLine Shopping Carts](https://docs.2checkout.com/analytics/analytics/tracking-capabilities-in-convertplus-and-inline-shopping-carts.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/analytics/analytics/implement-google-universal-analytics-in-convertplus-and-inline-checkout-with-gtm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
