Open the VTEX APP Store and install the app on your store.
or
Run the following command:
vtex install [email protected]
Next, open the app settings on your admin and fill the form with you GTM id.
This guide provides instructions to setup all the necessary Tags, Triggers, Variables, and configurations to Google Tag Manager and Google Analytics, so at the end of it you will have all the user and ecommerce analytics available in your Google Analytics dashboard.
Open the Google Tag Manager dashboard at https://tagmanager.google.com/.
To create a Variable, click on "Variables" on the menu on the left and then on the button New.
- Click in Variable Configuration
- Choose "Data Layer Variable"
- Type "campaignMedium" in "Data Layer Variable Name"
- Click Save, and save as "Data Layer Variable - campaignMedium"
Do the same thing for the variables: "campaignName" e "campaignSource".
- Click in Variable Configuration
- Choose "Google Analytics Settings"
- Type your Tracking ID
- Click in Ecommerce
- Click in "Enable Enhanced Ecommerce Features"
- Click in "Use data layer"
- Click Save, and save as "Google Analytics"
- Click in Variable Configuration
- Choose "Google Analytics Settings"
- Type your Tracking ID
- Click in More Settings
- Click in Fields to Set
- Add the fields:
Field Name | Value |
---|---|
campaignName | {{Data Layer Variable - campaignName}} |
campaignMedium | {{Data Layer Variable - campaignMedium}} |
campaignSource | {{Data Layer Variable - campaignSource}} |
- Click in More Settings
- Click in Ecommerce
- Click in "Enable Enhanced Ecommerce Features"
- Click in "Use data layer"
- Click Save, and save as "Google Analytics - Checkout and Order Placed"
To create a Trigger, click on "Trigger" on the menu on the left and then on the button New.
- Click in Trigger Configuration
- Choose "Custom Event"
- Type "addToCart" in Event Name
- Click Save, and save as "Custom Event - addToCart"
Repeat the previous steps creating new Triggers for the events: "cart", "email", "orderPlaced", "payment", "productDetail", "productImpression", "profile", "remoFromCart", and "shipping".
To create a Tag, click on "Tags" on the menu on the left and then on the button New.
- Click in Tag Configuration
- Choose "Google Analytics - Universal Analytics"
- Choose Track Type as "Event"
- Type "Ecommerce" in Category
- Type "{{Event}}" in Action
- In Google Analytics Settings choose "{{Google Analytics - Checkout and Order Placed}}"
- Choose the Triggers:
- "Custom Event - cart"
- "Custom Event - email"
- "Custom Event - orderPlaced"
- "Custom Event - payment"
- "Custom Event - profile"
- "Custom Event - shipping"
- Save as "Google Analytics - Checkout and Order Placed"
- Click in Tag Configuration
- Choose "Google Analytics - Universal Analytics"
- Choose Track Type as "Event"
- Type "Ecommerce" in Category
- Type "{{Event}}" in Action
- In Google Analytics Settings choose "{{Google Analytics}}"
- Choose the Triggers:
- "Custom Event - addToCart"
- "Custom Event - productDetail"
- "Custom Event - productImpression"
- "Custom Event - removeFromCart"
- Save as "Google Analytics - Enhanced Ecommerce"
- Click in Tag Configuration
- Choose Track Type as "Page View"
- In Google Analytics Settings choose "{{Google Analytics}}"
- Choose the Triggers: "All Pages"
- Save as "Google Analytics - Page View"