This guide walks you through configuring Google Analytics 4 (GA4) with Google Tag Manager (GTM) to track e-commerce events on your Pulse Commerce store. You'll learn how to set up conversion tracking for product views, checkout initiation, and purchases using the data that Pulse Commerce automatically sends to the GTM datalayer.
Pulse Commerce automatically sends data to the Google Tag Manager datalayer as customers navigate your store. This data includes information about what type of page they're viewing, product details, and order information.
What Pulse Commerce automatically provides:
- Page Type identification - Knows when customers are on product pages, category pages, cart, checkout, or order confirmation
- Product information - Sends product name, SKU, price, category, and brand on product detail pages
- Order details - Sends complete purchase data including order ID, revenue, tax, shipping, and items purchased on the order confirmation page
- Customer information - Sends customer first and last name when logged in
Your responsibility in GTM:
You need to create "events" (like view_item, begin_checkout, purchase) that tell GA4 when specific actions occur, and "triggers" that fire these events at the right time based on the page type data Pulse Commerce provides.
Complete these requirements before configuring event tracking:
Required Accounts & Access:
- Google Analytics 4 property created with Measurement ID (format: G-XXXXXXXXXX)
- Google Tag Manager container created with Container ID (format: GTM-XXXXXX)
- Admin access to your Pulse Commerce backend
- Admin access to your GTM container
1Install your GTM container in Pulse Commerce:
- Go to Marketing > Analytics & Media > Google Tag Manager
- Click Edit
- Enter your GTM Container ID (e.g., GTM-XXXXXX)
- Click Update
2Add your GA4 Configuration tag in GTM:
- In GTM, go to Tags > New
- Name it "GA4 Configuration"
- Click Tag Configuration and select Google Analytics: GA4 Configuration
- Enter your GA4 Measurement ID (G-XXXXXXXXXX)
- Under Triggering, select All Pages
- Click Save
Datalayer variables allow GTM to access the information Pulse Commerce sends. You'll create variables for page type, product information, and order details.
Create the Page Type Variable
This variable identifies what type of page the customer is viewing (Product, Shopping Cart, Order Confirmation, etc.).
1In GTM, go to Variables User-Defined Variables and click New
2Name the variable: pageType
3Click Variable Configuration and select Data Layer Variable
4In the Data Layer Variable Name field, enter: pageType
5Click Save
Create Product and Order Variables
Repeat the process above to create these additional variables:
| Variable Name in GTM | Data Layer Variable Name | Purpose |
|---|---|---|
ecommerce.detail.products |
ecommerce.detail.products |
Product information on product pages |
ecommerce.purchase |
ecommerce.purchase |
Complete order data on confirmation page |
ecommerce.purchase.actionField.revenue |
ecommerce.purchase.actionField.revenue |
Order total revenue |
Triggers tell GTM when to fire your analytics events. You'll create triggers that activate when customers reach specific page types.
Create Product Page Trigger
1In GTM, go to Triggers > New
2Name the trigger: Product Page View
3Click Trigger Configuration and select Page View
4Select Some Page Views
5Set the condition: pageType equals Product
6Click Save
Create Shopping Cart/Checkout Trigger
Repeat the process to create a trigger for when customers view their cart or begin checkout:
-
Trigger Name:
Shopping Cart or Checkout - Trigger Type: Page View
- Fires On: Some Page Views
-
Condition:
pageTypeequalsShopping CartORpageTypeequalsOrder Review
Create Order Confirmation Trigger
-
Trigger Name:
Order Confirmation - Trigger Type: Page View
- Fires On: Some Page Views
-
Condition:
pageTypeequalsOrder Confirmation
You should now have three triggers ready to use with your GA4 event tags.
The view_item event tracks when customers view product detail pages. This helps you understand which products generate the most interest.
1In GTM, go to Tags > New
2Name the tag: GA4 - View Item
3Click Tag Configuration and select Google Analytics: GA4 Event
4In Configuration Tag, select your GA4 Configuration tag
5In Event Name, enter: view_item
6Under Event Parameters, click Add Row and add:
-
Parameter Name:
items -
Value:
{{ecommerce.detail.products}}(use the variable you created)
7Under Triggering, select your Product Page View trigger
8Click Save
The begin_checkout event tracks when customers start the checkout process. This helps you measure how many people who view products actually proceed to checkout.
1In GTM, go to Tags > New
2Name the tag: GA4 - Begin Checkout
3Click Tag Configuration and select Google Analytics: GA4 Event
4In Configuration Tag, select your GA4 Configuration tag
5In Event Name, enter: begin_checkout
6Under Triggering, select your Shopping Cart or Checkout trigger
7Click Save
The purchase event is your most important conversion tracking. It captures complete order information including revenue, tax, shipping, and all items purchased.
1In GTM, go to Tags > New
2Name the tag: GA4 - Purchase
3Click Tag Configuration and select Google Analytics: GA4 Event
4In Configuration Tag, select your GA4 Configuration tag
5In Event Name, enter: purchase
6Under Event Parameters, add these rows:
| Parameter Name | Value (Variable) |
|---|---|
transaction_id |
{{ecommerce.purchase.actionField.id}} |
value |
{{ecommerce.purchase.actionField.revenue}} |
tax |
{{ecommerce.purchase.actionField.tax}} |
shipping |
{{ecommerce.purchase.actionField.shipping}} |
items |
{{ecommerce.purchase.products}} |
7Under Triggering, select your Order Confirmation trigger
8Click Save
ecommerce.purchase.actionField.id, ecommerce.purchase.actionField.tax, and ecommerce.purchase.actionField.shipping before setting up this tag, following the same process from Step 1.Before making your GTM configuration live, test that all events are firing correctly.
Using GTM Preview Mode
1In GTM, click the Preview button in the top right corner
2Enter your store's URL and click Connect
3A new window will open showing your store with a GTM debug panel at the bottom
4Navigate through your store and verify each event fires:
- Visit a product page → Should see GA4 - View Item tag fire
- View shopping cart → Should see GA4 - Begin Checkout tag fire
- Complete a test order → Should see GA4 - Purchase tag fire on confirmation page
5Click on each tag in the debug panel to verify:
- The correct trigger activated it
- The datalayer variables contain expected data
- No error messages appear
Using GA4 DebugView
While in GTM Preview mode, you can also verify events are reaching GA4:
1Open your GA4 property
2Go to Configure DebugView
3You should see your test session with events appearing in real-time as you navigate your store
4Click on each event to view its parameters and verify data accuracy
Publishing Your Configuration
Once you've verified everything works correctly:
1Exit Preview mode in GTM
2Click Submit in the top right corner
3Add a Version Name (e.g., "GA4 E-commerce Tracking Setup")
4Optionally add a Version Description explaining what you configured
5Click Publish
Tracking when customers add items to their cart is more complex because Pulse Commerce does not automatically send cart modification events to the datalayer. This requires creating custom click triggers for "Add to Cart" buttons.
Why This Is Complex
Unlike product views or purchases which are page-based (easy to track with pageType), cart additions are action-based. You need to:
- Identify the correct "Add to Cart" button element on each page type
- Create click triggers that fire only for those specific buttons
- Capture product information at the moment the button is clicked
- Handle variations in button behavior across homepage, category, and product pages
General Approach (High-Level)
If you want to implement add-to-cart tracking, you would:
1Create a Click trigger in GTM
- Trigger Type: Click - All Elements
- Fires on: Some Clicks
- Condition: Click element matches your "Add to Cart" button selector
2Enable built-in Click variables in GTM (Variables section)
- Click Element
- Click Classes
- Click ID
- Click Text
3Create a GA4 Event tag for add_to_cart that fires on your click trigger
4Test extensively across all page types where "Add to Cart" appears
Resources for Advanced Users
If you want to learn more about custom event tracking in GTM:
Why isn't my data showing up in GA4 reports?
Check these common issues:
- Timing: Allow 24-48 hours for data to appear in standard reports (real-time reports update immediately)
- GTM Not Published: Verify you clicked "Publish" after configuring tags - Preview mode doesn't send live data
- GTM Container ID: Confirm the Container ID is correctly entered in Pulse Commerce (Marketing Analytics & Media Web Analytics Google Tag Manager)
- GA4 Configuration Tag: Ensure your base GA4 Configuration tag is set to fire on "All Pages"
How do I verify my GTM container is installed correctly?
View the source code of your store's homepage (right-click View Page Source) and search for your GTM Container ID (GTM-XXXXXX). If it appears in the <head> section, it's correctly installed.
What's the difference between "Shopping Cart" and "Order Review" page types?
- Shopping Cart: The page where customers view their cart contents and can modify quantities
- Order Review: The final checkout page where customers review their order before submitting payment
Both represent checkout initiation, which is why the begin_checkout trigger includes both page types.
Can I track custom events or add more parameters?
Yes! You can create additional GA4 Event tags for any custom tracking needs. Just create a new tag, select "Google Analytics: GA4 Event", enter a custom event name, and define the trigger conditions. You can also add custom event parameters using any datalayer variables available from Pulse Commerce.
Where can I see what data Pulse Commerce sends to the datalayer?
Use GTM Preview mode and look at the "Data Layer" tab in the debug panel. This shows all variables and their values for each page you visit. You can also refer to the complete datalayer variable reference in our documentation.
Do I need to create a new tag for every event?
Yes, each GA4 event (view_item, begin_checkout, purchase, etc.) requires its own tag in GTM. However, all event tags reference the same base GA4 Configuration tag, so you only need one configuration tag.
What if I see duplicate purchase events in GA4?
This can happen if:
- Customers refresh the order confirmation page
- Multiple GA4 tags are firing on the same page (check for duplicate tags in GTM)
- Old analytics.js code is still present alongside GTM (contact support to remove legacy code)