Documentation
Feedback
Guides
Storefront Development

Storefront Development
Store FrameworkGoogle Tag Manager
Migrating Google Tag Manager app from major 2.x to major 3.x
Step-by-step to update the Google Tag Manager app to version 3.x.

Version 3.x of VTEX’s Google Tag Manager (GTM) app tracks the entire user’s journey through the store, from viewing a product to purchasing it, via events triggered by the variable ecommerceV2.

New and rearranged properties were added to the product schema to represent on the events and to track the user's journey and keep product information consistent across all areas of the store.

GTM 3.x propertyType
idRenewed property
variantRenewed property
nameRenewed property
quantityUnchanged property
priceUnchanged property
categoryUnchanged property
brandUnchanged property
dimension1New property
dimension2New property
dimension3New property

For more details on these properties, go to the section Product schema

Follow the steps below to update the GTM container and fetch the data from the ecommerceV2 variable.

Before you start

For Google Analytics (GA) to read the data from the variable ecommerceV2, you will need a GA variable for the store’s checkout responsible for tracking the Checkout and Order Placed pages.

Create the store's checkout variable by following the step For the store’s checkout in the Setting up Google Tag Manager documentation.

Step by step

Creating ecommerceV2

  1. Log in to your GTM account and click on the GTM container you want to work with.
  2. Click on Variables, and click on’ New’ in the User-Defined Variables section.
  3. Replace the Untitled Variable value with ecommerceV2.
  4. Click on Variable Configuration box.
  5. Then, on Page Variables, click on Data Layer Variable.
  6. In the Data Layer Variable Name field, type ecommerceV2.
  7. Click on Save:

{"base64":"  ","img":{"width":1905,"height":855,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":54179,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/images/vtex-io-documentation-migrating-google-tag-manager-app-0.png"}}

Using the ecommerceV2 variable on the Google Analytics tag

  1. Open the store’s checkout variable by clicking on Variables and in the User-Defined Variables section select it.
  2. Click on the Variable Configuration box and expand the More Settings menu.
  3. Then, click on Ecommerce and check the Enable Enhanced Ecommerce Feature option.
  4. Disable Use data layer option and, on the Read data from variable field, select {{ecommerceV2}}.
  5. Click on Save, and you should have a variable as the example below:

After executing the steps described, your Google Tag Manager container is ready to support the GTM 3.x major. Check your Google Analytics to see the impact on the results.

Updating Google Tag Manager settings

After installing the Google Tag Manager app 3.x major, you must update the app's settings to guarantee that previous data won't be be lost after the upgrade. To update the app's settings:

  1. Access the following link: https://{myaccount}.myvtex.com/admin/apps/vtex.google-tag-manager@3.3.1/setup/. Do not forget to change the value in brackets for your account name.
  2. In the field Google Tag Manager, type the GTM ID.

To find your store’s GTM ID, first, you need a container to the Tag Manager account. If you do not have one follow the create a new account and container tutorial and after find the GTM ID in The Container ID column of the container.

  1. Click on SAVE.

Product schema

To make the product information consistent across all store areas and help capture the entire user's journey on the store, Google Tag Manager 3.x. includes Enhanced Ecommerce properties to the product data schema as events. These properties enable stores to provide additional information, such as product printing, promotion, and sales data.

Prop nameDescription
idProduct ID - Previously SKU ID.
variantSKU ID - Previously SKU Name. The variant of the product, e.g., Rebel pink.
nameProduct Name - Previously Product Name or SKU Name.
quantityProduct quantity
priceProduct price.
categoryProduct category, e.g., Apparel.
brandProduct brand.
dimension1Product Reference ID.
dimension2SKU Reference ID.
dimension3SKU Name (does not include the Product Name).

The dimension1, dimension2, dimension3 properties are custom dimensions that you can use to collect and analyze data that Google Analytics does not automatically create.

For more information about custom dimensions and Enhanced Ecommerce, refer to Custom dimensions and metrics and Google Enhanced ecommerce official guide respectively.

Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
Was this helpful?
Yes
No
Suggest edits (Github)
Setting up Google Tag Manager
« Previous
Sending custom events to Google Tag Manager
Next »
See also
Vtex Google Tag Manager
Guides
Contributors
2
Photo of the contributor
Photo of the contributor
+ 2 contributors
On this page