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

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](/analytics/analytics/implement-google-analytics-4-in-convertplus-and-inline-checkout-with-gtm.md) using the data layer that we have on GA4 format.

## 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:

{% stepper %}
{% step %}

### Create a Google Tag Manager account and get Container ID

1. In your browser window, navigate to [Tag manager → All accounts](https://tagmanager.google.com/#/home).
2. Click the Create Account button.

![Google analytics via GTM\_1.png](/files/f235f70daf48fe0be86ac12991a12c54441686d7)

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

![Google analytics via GTM\_2.png](/files/62765838a4525620460ab1ab787bf5ee02d27a5d)
{% endstep %}
{% endstepper %}

## 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

1. In your Google Tag Manager account, navigate to Variables → User-Defined Variables → New.

![Google analytics via GTM\_3.png](/files/ccff14585a7666eea7cf2f563c6fce6f4f4f1ff1)

2. From the list provided by Google, select the Google Universal Analytics Settings option as Variable Type. Name your variable “Google Analytics Settings”.
3. Under Tracking ID add the Google Universal Analytics Tracking ID to which you wish to send data.
4. 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.

![google analytics tracking id.png](/files/a9c6d45e05d3b8150c48351cba9730c1eda5beaa)
{% endstep %}

{% step %}

### Configure cross-domain tracking & cookie flags

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

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

![google analytics with GTM\_step6\_new.png](/files/b03eda7405d09a171277f4bcfdec1cef58072a01)

7. Click Save.
   {% 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.

![Google analytics via GTM\_6.png](/files/5da9f8ee0bbf1251355c6782a2c3c77b601c1c46)
{% 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.

![trigger configuration.jpg](/files/bdc08f4f5a831eb3bc1c07dac25bd1c0ad7803ed)
{% 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.

![Google analytics via GTM\_9.png](/files/bf5bc5d5665b9ddb624cceb37cc827f6d3080551)

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.

![Google analytics via GTM\_10.png](/files/f97557bb212e6895656831126f2b7b8484091113)

12. In Triggering, select the Event Ecommerce Non-interactive trigger. ![Google analytics via GTM\_11.png](/files/cc9f18c80fa146a9048380418441adfb46a44c19)
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.

![Google analytics via GTM\_12.png](/files/c9934c605cf33451ec8df45fdf15884e07a55961)

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.

![Google analytics via GTM\_13.png](/files/d7ed64ca272e6922338f95d9c9a66e8b60082666)

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

![Event Ecommerce Interactive.JPG](/files/aa5faacf3cbb7ff5021333a276f99cc1de15d1d0)

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

## Enable Enhanced Ecommerce in your Google Universal Analytics account

{% stepper %}
{% step %}

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

![Google analytics via GTM\_15.png](/files/046a31a598c2b31ee8e546fd772d7e415b85e47a)

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

## Exclude the 2Checkout domains from the referral list

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

{% stepper %}
{% step %}

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

![Google analytics via GTM\_16.png](/files/3cb73f5e3ddf3f89926333ccdc5e8b2f3b19ac95)

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

## Test your Google Universal Analytics Settings

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

{% stepper %}
{% step %}

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.

![preview GTM.png](/files/49cf9ca04189ff3176bbbc5a1927ba777f856d29)
{% endstep %}

{% step %}
3\. Delete all existing domains in the preview configuration.

![delete all domains.png](/files/4731345d8be36ef17235f40275ce1bc3344fa10a)

4. Click Add domain.

![add domain.png](/files/2a467532f57b8cf5a805c3f4d2d326ba086d8096)

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

![click start.png](/files/9896a7383ac1d00f9dedd029750687371ed86f1d)

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

![tracking URL.png](/files/5ecd7a80f44aaec8e1be8ea0cc77a70682bad907)
{% endstep %}

{% step %}
7\. Click the X in the top-left corner of the preview pane.

![connecting to avangate.png](/files/334e200f67da746c9b490e7ed89c4d1a88e239da)

8. In the Tag Assistant tab, click Add domain.

![add domain tag assisstant tab.png](/files/5c3e289bb8b592a47b3eb3d21770bb1d163c4657)

9. Enter the buy-link you want to debug and click Start.

![debug buy-link.png](/files/ab50f10e99918344841ec44eb7a7c2b889eef235)

10. Go back to the Google Tag Manager debugger tab.

![debugger.png](/files/0ad103659a578d99524f8964a64dec492f1e6f33)
{% endstep %}

{% step %}
11\. Click Enable behind the “Connecting this window to avangate.net” pop-up.

![enable popup.png](/files/016ec071920f55f16a0232de23264af9bda352ba)

12. Click Continue.

![click continue.png](/files/9980e6f899ba121712d2fdc607f9cfcbc1c81ca7)

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

![debug success.png](/files/14a62bb5ea48ccf0a215221f12600cfa736939e3)
{% endstep %}
{% endstepper %}

Submit and publish your settings

![Google analytics via GTM\_20.png](/files/f900ea6bc11148bbd60a20378bdbd9850125ef41)

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

{% stepper %}
{% step %}

### Configure Merchant Control Panel

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.

![web analytics in Merchant Control Panel\_5.png](/files/2240d79e6da13cc3255b8cfc534ef04dc8f86f4b)

5. In the Google Tag Manager box, click Set up.

![Select Google Tag Manager with UA](/files/dbdc301446c4d0d485f57c71d6394977f4e8d1f6)

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

![GTM with UA insert container ID](/files/64098e2f6a8dce9039b5de45743b87a30e8e65ad)

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.

![ConvertPlus & Inline Checkout - Activate Google Tag Manager with UA](/files/7f9600aa129eea04d06ba515a7d312c3a42d644e)
{% endstep %}
{% endstepper %}

{% hint style="info" %}

1. 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.
2. 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>
3. 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 on how to build custom dimensions through Google Tag Manager: <https://support.google.com/tagmanager/answer/6164990?hl=en>
   {% endhint %}

Related guides

* [Implement Google Universal Analytics in ConvertPlus and InLine Checkout (without GTM)](/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](/analytics/analytics/google-tag-manager-code-integration-for-default-flows-google-analytics-4.md)
* [Tracking capabilities in ConvertPlus and InLine Shopping Carts](/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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
