If your store is built with Store Framework, you also need to install the Google Tag Manager pixel app to integrate all pages. See how to do this in the app documentation.
Google Tag Manager is a tag management system created by Google to manage JavaScript and HTML tags used for website tracking and analytics.
On VTEX, the Google Tag Manager integration is native, which simplifies setting up the tool for analyzing store browsing data.This article explains the prerequisites and the setup steps in the following sections:
- Prerequisites
- Configure tags on Google Tag Manager
- Edit Checkout settings
- VTEX IO: Install the Google Tag Manager pixel app
Prerequisites
Before setting up Google Tag Manager, you need to complete the following steps:
- Create a Google Tag Manager account.
- Configure Google Analytics 4, which is step one in the Configuring Google Analytics 4 in VTEX stores guide.
Configuring tags on Google Tag Manager
Through tags, Google Analytics allows you to access essential data regarding your store's performance, such as the number of visits and conversions. For more information, go to Setting up GA4 event.
Editing Checkout settings
After this, you have to set up the store identification code from Tag Manager on VTEX following the steps below:
- In the VTEX Admin, go to Store Settings > Storefront > Checkout, or type Checkout in the search bar at the top of the page.
- Click in the icon of the desired website.
- In the blue option menu at the top of the page, click Checkout.
- In the Google Tag Manager field, enter the store identification code in
GTM-XXXX
format, as shown in the image below. - Click
Save
.
To check available events (triggers) and variables on the pages, which will be used in the tags, you can use the Google Tag Manager preview mode. For more information, check the Google Tag Manager documentation.
You can use the Facebook pixel app among your store's Google Tag Manager to track and optimize your marketing campaigns' results on the social network. Learn the step-by-step here.
VTEX IO: Installing the Google Tag Manager pixel app
If your store uses VTEX IO - Store Framework, in addition to the setup, you need to install a new version of the Google Tag Manager app. For more information, see Installing Google Tag Manager.
This step is not required for stores using the Legacy CMS Portal.