Skip to main content

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

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

Last updated: 29-Feb-2024
Rate this article:

Overview

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

Availability

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

Google Analytics 4 Settings

Implement Google Analytics 4

To implement Google Analytics 4 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.

2. Click on the Create Account button.

Google analytics via GTM_1.png

3. Fill in all the required fields:

  • Account Name
  • Country
  • Container name
  • Target platform → Web

4. Click on 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.

Google analytics via GTM_2.png

Creating the Google Analytics 4 Configuration tag in Google Tag Manager  

1. Click to create a new tag in Google Tag Manager and select Google Analytics: GA4 Configuration from the list pre-defined tags.

This is used for configuring Google Analytics 4 and sending pageviews to the new Google Analytics 4, for both the 2checkout shopping cart and your website where you have the Google Tag Manager code. If you already have in place a Google Analytics 4 Configuration Tag that fires on all pages where the Google Tag Manager code was added, you do not need to create a new tag. However, you need to make sure you add the cookie_flags configuration, described in step 4 below. This configuration is necessary, as the tracking script is placed in an iframe for ConvertPlus and Inline carts.

Configuration Tag

2. In the Measurement ID section in Google Tag Manager, enter the Measurement ID. You can find the ID in your Google Analytics 4 with the following steps:

  • Navigate to Admin -> Data Streams.
  • Click on your website property
  • Copy the Measurement ID. 

Measurement ID

3. Click on the Send a page view event when the configuration loads checkbox.

4. In the Fields to set section select the following to add the cookie_flags configuration: 

  • For Field Name add cookie_flags 

  • For Value add SameSite=None;Secure 

5. In the Triggering section, select All Pages

Configuration All Pages

Sending ecommerce information to Google Analytics 4 from the 2checkout shopping cart 

Configure a trigger in Google Tag Manager 

In Google Tag Manager, click on the Triggers section and then click to add a new trigger.

Google analytics via GTM_5.png

 

Create a Custom Event trigger

  1. Name your trigger GA4 Event Ecommerce Trigger.
  2. From the list provided, choose Custom event as Trigger Type.
  3. In the field Event name, type  .*  and check the box Use RegEx matching.
  4. For the "This trigger fires on" section, select Some custom events.
  5. As rule, fill in the boxes with Event matches RegEx (Ignore case) begin_checkout|add_to_cart|remove_from_cart|purchase|view_item_list. Those are events in the dataLayer on the format of the GA4 documentation for developers provided by Google
  6. Click Save.

GA4 Event Trigger

Configure the tag for GA4 for sending ecommerce data 

  1. Click on New to create a new tag that you can call “GA4 Event Ecommerce Tag”.
  2. From the list provided by Google, select the option “Google Analytics: GA4 event” as Tag Type.
  3. For Configuration Tag, select your previously configurated “Google Analytics 4 Configuration” tag.
  4. For Event Name, select {{Event}}.
  5. Under More Settings → Ecommerce , click on the Send Ecommerce data checkbox and select Data Layer from the Data Source drop-down list.

Event Tag 1
Event Tag 2

  6.  Add as trigger for this tag the previously created trigger “GA4 Event Ecommerce Trigger”

GA4 Ecommerce Event Trigger

Setup Cross-domain measurement in your Google Analytics 4 Admin page 

Google Tag Manager code is placed in an iframe with the domain tracking.avangate.net. In order for Google to recognize that a visitor is the same when entering your website and then entering the shopping cart, you need to setup cross-domain measurement in Google Analytics 4 Admin, according to information provided by Google.  

  1. In Admin, click on Data Streams, click on Web and then select your web data stream. In the web stream details, click Configure tag settings (at the bottom). In the Settings section, click Configure your domains

Configure your Domains

  2.  Under Include domains that match ANY of the following conditions, chose match type Contains and under Domain, enter the identifier of your domain (ex. yourwebsite.com) and then click Add Condition to add the next domains – tracking.avangate.net and secure.2checkout.com.

Configuration

Test your Google Analytics 4 Settings with GTM Debugger

To test if your Google Analytics settings are correct, follow the steps below 

 1. Download and install the Tag Assistant Companion browser extension found here.

 2. Click on Preview.

preview GTM.png

3. Delete all existing domains.

delete all domains.png

4. Click on Add domain.

add domain.png

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

click start.png

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

tracking URL.png

7. Click on X in the top-left corner.

connecting to avangate.png

8. In the Tag Assistant Tab, click on Add domain.

add domain tag assisstant tab.png

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

debug buy-link.png

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

debugger.png

11. Click on the Enable button behind the “Connecting this window to avangate.net” pop-up.

enable popup.png

12. Click on Continue.

click continue.png

13. You are now debugging tracking.avangate.net, but this domain receives tags from the shopping cart.

debug success.png

Submit and publish your settings

Google analytics via GTM_20.png

Checking a purchase in Google Analytics 4

Place an order on the 2checkout shopping cart, using the template which has your Google Tag Manager code.  

Log into your Google Analytics 4, go to Monetization -> Ecommerce purchases. 

Monetization

You will see the number of purchases for your products and the revenue from your purchases. 

Test Product

Merchant Control Panel Settings

The Analytics section in your Merchant Control Panel allows you to integrate Google Analytics 4 or/and Google Tag Manager(with GA 4) in the ConvertPlus or InLine ordering engines and thus track the behavior of your shoppers on the 2Checkout pages.

Follow these steps to complete your analytics integration:

  1. Log into your Merchant Control Panel.
  2. Navigate to Setup → Ordering options.
  3. Click on the Analytics tab.
  4. Click on the ConvertPlus and InLine Checkout tab.

Shopping Cart Web Analytics

5. In the Google Tag Manager(with GA 4) box, click on Set up and fill in the Google Tag Manager(with GA4) Container ID.

6. Click Save.

Google Tag Manager Container ID

7. Complete the integration by using the slider to activate Google Tag Manager. It is not recommended to activate both Google Analytics 4 and Google Tag Manager to send data to the same Google Analytics 4 property, otherwise, duplicate data will occur. 

Activate GTM using slider

 

Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo