Skip to main content

Connecting Google Tag Manager (GTM) and Google Analytics 4 (GA4)

Implement tags and tracking codes on your checkouts using GTM and get more insight into how users interact with your payment pages.

Written by Jelle Graafstal
Updated today

Google Tag Manager (GTM) is a handy tool for implementing tags and tracking codes on your checkouts. With our GTM integration including Google Analytics 4 (GA4) you get more insight into how users interact with your payment pages.

We will show you step by step how to implement our GTM integration in Plug&Pay!


Adding Your GTM Code to Plug&Pay

First you will need to add your GTM code to Plug&Pay. After logging in to your Google Tag Manager account, select the container you want to work with by clicking on it. At the top you can click on the Admin tab. Here you will see a code that starts with GTM-.

This is a unique code that you need to enter in Plug&Pay.

In Plug&Pay go to Settings > Analytics (under the Connections & Integrations section). Here, under Google > Tracker, you can choose Google Tag Manager and enter the GTM code.

❗️ Please note: If you want to measure conversions, you also need to send the e-commerce data.


Importing the JSON File

For our integration with GTM and GA4 we have a JSON file. This file contains all required configuration settings, tags, and triggers. You can simply upload this file without having to manually configure anything!

In GTM go to Admin > Import Container.

Here you can upload the downloaded JSON file. For the workspace, choose the desired workspace, and for the import option choose Merge.

Whether you overwrite or rename conflicting tags, triggers, and variables depends on your current GTM setup. If you are unsure, it is best to choose Rename. That way, if you have duplicate tags, you can adjust them manually afterwards and you will not suddenly lose any tags.

Once you have done this, you will see that a number of tags and triggers are added to your GTM!


Adding GA4

Next you will need to add your GA4 ID. We use a variable, and you will need to update it with your GA4 ID so that everything is tracked via your Google Analytics.

You do this by going to Variables and then updating the GA4 measurement ID.

Click the pencil icon and change the Value to your GA4 ID.

Please note: with these settings you are adding GA4 to your GTM again. Keep this in mind if you are already using GA4, so that you do not accidentally start measuring double.


Which Tags Are Fired?

Under Tags you can see which tags are fired when an order is placed in Plug&Pay. A tag called begin_checkout is fired, which is triggered by a page view on the checkout itself. In addition, there is a separate tag for purchase, for all people who have actually made a purchase.

Please note: It can take 24 to 48 hours before data starts coming in to your GA4. It is possible that you have set everything up correctly but simply need to wait a little before you see your data.


Creating a Report

You now have triggers and tags loaded in GTM, and tracking is being done via GA4.

You can create a report in GA4 so that the desired data is directly visible. You do this by going to Explore in Google Analytics.

You can create a blank report. You can then add the following variables.

Dimensions:

  • Transaction ID

  • Item name

  • Date.

Metrics:

  • Items purchased

  • Item revenue

  • Items viewed.

You can then add these variables to the tab settings to create an overview.

In this created overview you will see the orders and the associated revenue.

With this GTM and GA4 integration, you should be able to properly track your sales data. You can use our report as an example, but of course you can also go further and create reports that suit your business. Good luck!


Enabling Do Not Track (DNT)

Are you using videos on your landing pages, such as Vimeo or YouTube videos? Then enable Do Not Track (DNT) on these videos. This additional setting prevents tracking pixels from these videos from being forwarded to Google Tag Manager without the user's consent. This is necessary to run your Google Ads.

Click on the video in the page builder and enable the toggle below πŸ‘‡

Did this answer your question?