Google Tag Manager Setup Guide

TABLE OF CONTENTS


Google Tag Manager Setup

To implement Google Analytics 4 Pageview Tracking and Enhanced E-commerce Tracking, you must first create a Google Tag Manager (GTM) account and container.

  1. Navigate to the https://tagmanager.google.com/ Google Tag Manager website .
  2. Sign in using your Google account credentials.
  3. Click Create Account.
  4. Enter your Account Name (usually your company or organization name).
  5. Select the appropriate Country.
  6. Click Continue.
  7. Enter the Container Name (typically your website domain).
  8. Select Web as the target platform.
  9. Click Create and accept the Google Tag Manager Terms of Service.
  10. After the container is created, Google Tag Manager generates a unique Container ID (for example: GTM-ABC1234). This Container ID must be configured in Znode Admin.
Note: Save the generated GTM Container ID. It is required when configuring Google Tag Manager settings within Znode.


 


Create a Container

After creating a Google Tag Manager account, create a new container for the storefront website. The container serves as a repository for all tracking configurations, including tags, triggers, variables, and templates.

  1. Open the Google Tag Manager account.
  2. Click Create Container.
  3. Enter a descriptive Container Name (typically the website domain).
  4. Select Web as the target platform.
  5. Click Create and accept the terms of service.

Once the container is created, you can configure the required Templates, Triggers, Tags, and Variables needed for Google Analytics 4 Pageview Tracking and Enhanced E-commerce Tracking.

 

Import Znode Tracking Configuration

For new Znode installations that do not have any existing analytics or tracking setup, the required Google Tag Manager configuration can be imported using the tags.json file.

  1. Open the GTM container.
  2. Navigate to Admin > Import Container.
  3. Select the provided tags.json file.
  4. Choose the appropriate workspace.
  5. Review the imported Tags, Triggers, and Variables.
  6. Click Confirm to complete the import.
Note: The imported configuration provides the baseline setup required for Znode storefront tracking. Review the configuration before publishing changes to production.

Configure Google Analytics Measurement ID

After importing the container configuration, a valid Google Analytics 4 Measurement ID must be configured. Without a valid Measurement ID, tracking events will not be recorded in Google Analytics.

  1. Open the imported GA4 Configuration Tag.
  2. Locate the Measurement ID field.
  3. Enter the GA4 Measurement ID (for example: G-XXXXXXXXXX).
  4. Save the tag configuration.
  5. Submit and publish the container changes.
Important: Tracking data will only be sent to Google Analytics after the Measurement ID is configured and the container version is published.


 

Manual Configuration

The following sections describe how to manually configure the templates, triggers, variables, and tags required for Znode storefront tracking. These instructions can be used when:

  • Adding tracking to an existing Google Tag Manager container.
  • Migrating from another analytics implementation.
  • Reviewing or customizing the default Znode tracking configuration.
  • Troubleshooting tracking issues in an existing storefront.

The configuration includes setup for Google Analytics 4 page view tracking and Enhanced E-commerce events such as product impressions, product views, add-to-cart actions, checkout events, and purchase transactions.

Tags, Triggers, Variables & Templates

Add Template

Navigate to Templates within the Google Tag Manager workspace and add the required template used for Enhanced E-commerce data transformation.

Add Variable Template

Select Search Gallery and add the following variable template to the workspace:

  • EEC Products -> GA4 Items
Purpose: This template converts Enhanced E-commerce product objects into the Google Analytics 4 item structure required for ecommerce event tracking.

Add Variables

EEC Products -> GA4 Items Variable

SettingValue
Variable NameEEC Products -> GA4 Items
Variable TypeEEC Products -> GA4 Items (Custom Template)
Map SourceMap ecommerce object automatically (Default)

Currency Code Variable

SettingValue
Variable NameCurrency Code
Variable TypeData Layer Variable
Data Layer Variable Nameecommerce.currencyCode
Data Layer VersionVersion 2

Product Value Variable

SettingValue
Variable NameProduct Value
Variable TypeData Layer Variable
Data Layer Variable Nameecommerce.detail.products.0.price
Data Layer VersionVersion 2

Add to Cart Value Variable

SettingValue
Variable NameAdd to Cart Value
Variable TypeData Layer Variable
Data Layer Variable Nameecommerce.add.products.0.price
Data Layer VersionVersion 2

Ecommerce Transaction Variable

SettingValue
Variable NameEcommerce Transaction
Variable TypeData Layer Variable
Data Layer Variable Nameecommerce.purchase.actionField.id
Data Layer VersionVersion 2

Ecommerce Value Variable

SettingValue
Variable NameEcommerce Value
Variable TypeData Layer Variable
Data Layer Variable Nameecommerce.purchase.actionField.revenue
Data Layer VersionVersion 2

Ecommerce Currency Variable

SettingValue
Variable NameEcommerce Currency
Variable TypeData Layer Variable
Data Layer Variable Nameecommerce.purchase.actionField.currency
Data Layer VersionVersion 2
Note: These variables retrieve ecommerce data from the Znode storefront data layer and are referenced by Google Analytics 4 tags to track product views, add-to-cart events, and completed purchases.


Add Tags & Triggers

Create the following Google Analytics 4 tags and triggers to capture page views, product detail views, and product selection events within the Znode storefront.

Google Analytics All Page Tracking

Configure a GA4 Configuration tag to track page views across the entire storefront.

SettingValue
Tag NameGoogle Analytics 4 - Pageview
Tag TypeGoogle Analytics: GA4 Configuration
Measurement IDEnter the Measurement ID from Google Analytics Admin
Send a Page View EventTrue
Trigger Configuration
SettingValue
Trigger NameAll Pages
Trigger TypePage View
Trigger ConditionAll Page Views
Purpose: Tracks page view activity across the storefront and serves as the base configuration for all GA4 events.

Product Detail Views

Configure a GA4 Event tag to track product detail page views.

SettingValue
Tag NameProduct Detail View
Tag TypeGoogle Analytics: GA4 Event
Configuration TagSelect the Google Analytics 4 - Pageview tag
Event Nameview_item
Event Parameters
Parameter NameValue
items{{EEC Products -> GA4 Items}}
currency{{Currency Code}}
value{{Product Value}}
Ecommerce Settings
SettingValue
Send Ecommerce DataTrue
Data SourceData Layer
Trigger Configuration
SettingValue
Trigger NameProduct Detail View Trigger
Trigger TypeCustom Event
Event Nameview_item
Trigger ConditionAll Custom Events
Data Layer Elements Tracked
  • SKU
  • Product Name
  • Category Name
  • Brand Name
  • Product Price
  • Currency Code
Purpose: Records product detail page views and sends product metadata to Google Analytics 4.

Product Clicks

Configure a GA4 Event tag to track product selections from Product Listing Pages (PLP), Search Results Pages (SRP), and other product collections.

SettingValue
Tag NameProduct Click
Tag TypeGoogle Analytics: GA4 Event
Configuration TagSelect the Google Analytics 4 - Pageview tag
Event Nameselect_item
Event Parameters
Parameter NameValue
items{{EEC Products -> GA4 Items}}
Ecommerce Settings
SettingValue
Send Ecommerce DataTrue
Data SourceData Layer
Trigger Configuration
SettingValue
Trigger NameProduct Click Trigger
Trigger TypeCustom Event
Event Nameselect_item
Trigger ConditionAll Custom Events
Data Layer Elements Tracked
  • SKU
  • Product Name
  • Category Name
  • Currency Code
Purpose: Tracks user interactions with products selected from listings, search results, and merchandising components.

Add to Cart

Configure a GA4 Event tag to track when customers add products to their shopping cart.

SettingValue
Tag NameAdd To Cart
Tag TypeGoogle Analytics: GA4 Event
Configuration TagSelect the Google Analytics 4 - Pageview tag
Event Nameadd_to_cart
Event Parameters
Parameter NameValue
items{{EEC Products -> GA4 Items}}
currency{{Currency Code}}
value{{Add To Cart Value}}
Ecommerce Settings
SettingValue
Send Ecommerce DataTrue
Data SourceData Layer
Trigger Configuration
SettingValue
Trigger NameAdd To Cart Trigger
Trigger TypeCustom Event
Event Nameadd_to_cart
Trigger ConditionAll Custom Events
Data Layer Elements Tracked
  • SKU
  • Product Name
  • Brand Name
  • Variant (if applicable)
  • Quantity
Purpose: Tracks products added to the shopping cart and provides detailed product data for GA4 ecommerce reporting.

Remove from Cart

Configure a GA4 Event tag to track when customers remove products from their shopping cart.

SettingValue
Tag NameRemove From Cart
Tag TypeGoogle Analytics: GA4 Event
Configuration TagSelect the Google Analytics 4 - Pageview tag
Event Nameremove_from_cart
Event Parameters
Parameter NameValue
items{{EEC Products -> GA4 Items}}
Ecommerce Settings
SettingValue
Send Ecommerce DataTrue
Data SourceData Layer
Trigger Configuration
SettingValue
Trigger NameRemove From Cart Trigger
Trigger TypeCustom Event
Event Nameremove_from_cart
Trigger ConditionAll Custom Events
Data Layer Elements Tracked
  • SKU
  • Product Name
  • Brand Name
  • Variant (if applicable)
  • Quantity
Purpose: Tracks products removed from the shopping cart and provides visibility into cart abandonment and customer shopping behavior.

Checkout Behavior Report

Configure a GA4 Event tag to track when customers begin the checkout process. This event helps measure checkout initiation and identify potential drop-off points in the purchase journey.

SettingValue
Tag NameCheckout Tag
Tag TypeGoogle Analytics: GA4 Event
Configuration TagSelect the Google Analytics 4 - Pageview tag
Event Namebegin_checkout
Event Parameters
Parameter NameValue
items{{EEC Products -> GA4 Items}}
Ecommerce Settings
SettingValue
Send Ecommerce DataTrue
Data SourceData Layer
Trigger Configuration
SettingValue
Trigger NameCheckout Trigger
Trigger TypeCustom Event
Event Namebegin_checkout
Trigger ConditionAll Custom Events
Data Layer Elements Tracked
  • SKU
  • Product Name
  • Brand Name
  • Variant (if applicable)
  • Quantity
Purpose: Tracks when a customer initiates the checkout process and passes product information to Google Analytics 4 for checkout funnel reporting.

Purchase

Configure a GA4 Event tag to track completed purchases. This event records transaction details and revenue data and is used to measure ecommerce performance and conversions.

SettingValue
Tag NamePurchase Tag
Tag TypeGoogle Analytics: GA4 Event
Configuration TagSelect the Google Analytics 4 - Pageview tag
Event Namepurchase
Event Parameters
Parameter NameValue
transaction_id{{Ecommerce Transaction}}
value{{Ecommerce Value}}
items{{EEC Products -> GA4 Items}}
currency{{Ecommerce Currency}}
Ecommerce Settings
SettingValue
Send Ecommerce DataTrue
Data SourceData Layer
Trigger Configuration
SettingValue
Trigger NamePurchase Trigger
Trigger TypeCustom Event
Trigger ConditionCustom Event with Page URL validation
Trigger Conditions
VariableOperatorValue
Page URLContains/order/receipt

Replace /order/receipt with the storefront's order confirmation or receipt URL if a different route is used.

Data Layer Elements Tracked
  • SKU
  • Product Name
  • Brand Name
  • Variant (if applicable)
  • Quantity
  • Transaction ID
  • Order Revenue
  • Currency
Purpose: Records completed ecommerce transactions in Google Analytics 4, including revenue, purchased products, and transaction identifiers required for conversion tracking and sales reporting.

Validation

After configuring all tags, triggers, variables, and templates:

  1. Open Google Tag Manager Preview Mode.
  2. Navigate through the storefront and perform test actions.
  3. Verify the following events are fired:
    • view_item
    • select_item
    • add_to_cart
    • remove_from_cart
    • begin_checkout
    • purchase
  4. Review the event payload and confirm all ecommerce parameters are populated correctly.
  5. Validate the events in Google Analytics 4 DebugView.
  6. Publish the GTM container after successful validation.
Important: Ecommerce reporting in Google Analytics 4 relies on accurate data layer values. Ensure that product details, transaction information, and currency values are populated before publishing the container configuration to production.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.