GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial
Last Updated: February 3, 2023
Table of Contents
[hide]- Understanding Google Analytics 4 ecommerce tracking
- Setting up ecommerce tracking in Google Analytics 4 using Google Tag Manager
- 1. Product/item list views/impressions
- 2. Product/item list clicks
- 3. Product/item detail views
- 4. Add to cart
- 5. Remove from cart
- 6. Promotion views/impressions
- 7. Promotion clicks
- 8. Checkouts
- 9. Purchases
- 10. Refunds
- Ecommerce reporting in GA4
- Update: New dimensions and metrics for ecommerce in GA4
- Other articles related to GA4
- Other articles on Google Analytics Ecommerce
Understanding Google Analytics 4 ecommerce tracking
In this article, I will show you how to set up ecommerce tracking in Google Analytics 4 (GA4) using Google Tag Manager (GTM).
With Google Analytics 4 properties, ecommerce implementation is a bit different compared to the legacy version, also known as Universal Analytics.
I recommend following the developer’s documentation Ecommerce (GA4) Developer Guide alongside this article.
If we compare Google Analytics 4 vs Universal Analytics, there are a few similarities and differences, as below.
1) Schema changes
While setting up the ecommerce events, we need to pass the different schemas like product details, currency, promotions, etc.
For example, earlier in Universal Analytics, if we wanted to pass a product name, we used to pass it using ‘name’, but in the case of GA4, it is just ‘item_name’.
Another example,
If you want to measure a promotion (when a user clicks on any promotion link), in universal analytics, we used to pass this using ‘promoClick’, but in the case of GA4, it has now changed to ‘select_promotion’.
The table below will provide details on the different schemas and changes.
No Google
Analytics 4 Universal Analytics Description 1 view_promotion promoView When a user views a promotion 2 select_promotion promoClick When a user clicks on a promotion 3 view_item_list impressions View of product impressions in a list 4 select_item productClick Click on a product 5 view_item detail View product details 6 add_to_cart addToCart Add product to cart 7 add_to_wishlist N/A Add product to a wishlist 8 remove_from_cart removeFromCart Remove product from the cart 9 view_cart N/A View shopping cart 10 begin_checkout checkout Initiate the checkout process 11 add_shipping_info checkout_option Add shipping info during the checkout 12 add_payment_info checkout_option Add payment info during the checkout 13 purchase purchase Purchase product 14 refund refund Refund product 15 item_id id Product ID / SKU 16 item_name name Name of the product 17 item_list_name list Product list name 18 item_list_id N/A Product list identifier 19 index position Product position in the list 20 item_brand brand Product brand 21 item_category category Product category 22 item_category_2 category Product category 2nd level 23 item_category_3 category Product category 3rd level 24 item_category_4 category Product category 4th level 25 item_category_5 category Product category 5th level 26 item_variant variant Product variant name or description 27 affiliation N/A The store affiliation 28 discount N/A Any discount on product 29 coupon coupon Coupon code used 30 price price Product price 31 currency N/A User currency 32 quantity quantity Product quantity 33 promotion_id id Promotion ID 34 promotion_name name Promotion name 35 transaction_id id Unique ID for the transaction required for purchase and refund events 36 value revenue Product revenue 37 shipping shipping Shipping charges for selected product in the cart 38 payment_type option The payment method sent with add_payment_info
2) Data layer implementation
You might be thinking of updating your data layer according to the new schemas, but wait!
If you are using Universal Analytics for your ecommerce website, do not update your current setup.
This is because the new schemas are not backwards compatible and hence can break your current (Universal Analytics) setup.
The good news is that most of the schemas are forward-compatible, and Google will translate your Universal Analytics events to the GA4 App + Web custom events.
The best thing to do to keep both versions of analytics active and running is to update your current setup to add GA4 App + web specific dataLayer and schemas along with current schemas.
This way, it won’t break your Universal Analytics, and the GA4 App + Web will also have its required schemas.
Now let’s get started with setting up ecommerce tracking in Google Analytics 4
Setting up ecommerce tracking in Google Analytics 4 using Google Tag Manager
Note: Ecommerce events can also be implemented using a global site tag (gtag.js). In our case, we will be using Google Tag Manager.
While implementing the ecommerce tracking, we need to define or modify our DataLayer on the page, and this needs development work to update the values.
If you are unfamiliar with the dev work, you can ask your developer to implement the DataLayer. Once the DataLayer is defined, you can configure the DataLayer variable in GTM.
Follow the below steps to create an ecommerce DataLayer variable.
Step 1: Log in to your Google Tag Manager console and click on ‘Variables’ in the left-hand side menu.


Step 2: Click on ‘New’.


Step 3: Give your variable a proper name and click ‘Variable Configuration’.


Step 4: An overlay will appear like the one below. Select the Data Layer variable.


Step 5: Variable configuration will open like below. Type ‘ecommerce.items’ as the Data Layer variable name.


Step 6: Click on ‘Save’.



Since our Data Layer variable is configured, we can proceed with implementing ecommerce events. We will be measuring the standard ecommerce events.
The section below will provide details of the DataLayer code, GTM tag configuration and trigger condition.
1. Product/item list views/impressions
This event will measure product impressions. We need to fire this tag on the pages where a list of products is displayed, generally on the home page, category pages, etc.
DataLayer configuration:
To measure item list views/impressions, we need to push a list of products and their attributes to the data layer and pass a ‘view_item_list’ event along with that data.
// Measure product views / impressions
dataLayer.push({
'event': 'view_item_list',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'item_list_name': 'Search Results', // Product List Name - Type: string
'item_list_id': 'SR12', // Product List ID - Type: string
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, the next step is to configure your tag. Follow the below steps to configure.
Step 1: Log in to your Google Tag Manager console and click on ‘Tags’ in the left-hand side menu.


Step 2: Click on ‘New’ to create a new scroll event tag for the GA4 property.


Step 3: Give a proper name to your tag and click on ‘Tag Configuration’.


Step 4: An overlay with a list of tag templates will appear on the right-hand side. Select ‘Google Analytics: GA4 Event’.


Step 5: Tag configuration window will open like below. Click on ‘Select Configuration Tag’.


Step 6: A drop-down menu will appear. You can either select your pageview tag or ‘None- Manually Set ID’ from the drop-down. We will select ‘None- Manually Set ID’ in our case.


Step 7: The next step is to enter the GA measurement ID in the input box.
Your measurement ID is in the admin section under ‘Data Streams’.




Step 8: Specify the name of the event. The event name you provide here will appear in your GA4 analytics reporting. Now give an event name as ‘view_item_list’.


Step 9: Click on the ‘Event Parameters‘ drop-down menu:


Step 10: Click on the ‘Add Row’ button:


You should now see the two new text boxes: ‘Parameter Name’ and ‘Value’.


Step 11: Type ‘items’ in the ‘Parameter Name’ text box.


Step 12: Click on the ‘+’ button under the ‘Value’ text box:


Step 13: An overlay will appear like the one below. Select the ‘GA4 Ecommerce DataLayer’ variable. This is the same variable that we created earlier.


Step 14: Your tag configuration will appear like the one below.


It’s done! Now let’s set up the trigger configuration.
Trigger Configuration:
Step 15: Click anywhere under ‘Triggering’.


Step 16: An overlay will appear like the one below. Click on the ‘+’ icon to add a new trigger.


Step 17: Give a proper name to your trigger and click anywhere in ‘Trigger Configuration’.


Step 18: An overlay will appear like the one below. Select ‘Custom Event’ from the list.


Step 19: ‘Trigger Configuration’ will open. In the input box, we need to provide the event name. In this event, it is ‘view_item_list’ since we are measuring product impressions. Type ‘view_item_list’ In the event name.


Step 20: Click on ‘Save’.



Your complete tag will look like the one below.


Congratulations!!! You have successfully created your first ecommerce event for your GA4 property.
Now let’s do this for the remaining ecommerce events.
Since I already showed you the step-by-step method to create it in the above event, I will now only show you the DataLayer code and final tag configuration and trigger configuration for the other events.
2. Product/item list clicks
DataLayer configuration:
To measure product clicks, we need to push the product and its attributes to the data layer and pass a ‘select_item’ event along with that data.
// Measure product Clicks
dataLayer.push({
'event': 'select_item',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'item_list_name': 'Search Results', // Product List Name - Type: string
'item_list_id': 'SR12', // Product List ID - Type: string
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: select_item
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘select_item’


3. Product/item detail views
To measure product views, we need to push the product and its attributes to the data layer and pass a ‘view_item’ event along with that data.
// Measure Product Detail View
dataLayer.push({
'event': 'view_item',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'item_list_name': 'Search Results', // Product List Name - Type: string
'item_list_id': 'SR12', // Product List ID - Type: string
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: view_item
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘view_item


4. Add to cart
To measure add to cart, we need to push the product and its attributes to the data layer and pass a ‘view_item’ event along with that data.
// Measure Add to Cart
dataLayer.push({
'event': ' add_to_cart',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'item_list_name': 'Search Results', // Product List Name - Type: string
'item_list_id': 'SR12', // Product List ID - Type: string
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: add_to_cart
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘add_to_cart’


5. Remove from cart
To measure remove from cart, we need to push a product and its attributes to the data layer and pass a ‘remove_from_cart’ event along with that data.
// Measure Remove From Cart
dataLayer.push({
'event': ' remove_from_cart',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'item_list_name': 'Search Results', // Product List Name - Type: string
'item_list_id': 'SR12', // Product List ID - Type: string
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: remove_from_cart
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration.
- Trigger type: Custom event
- Trigger condition: event equals ‘remove_from_cart’


6. Promotion views/impressions
You can measure both impressions and clicks on internal site promotions. These promotions include banners displayed on the site or an offer for free shipping.
To measure promotion view details, we need to push the product and its attributes to the data layer and pass a ‘view_promotion’ event along with that data.
// Measure promotion views/impressions
dataLayer.push({
'event': 'view_promotion',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'promotion_id': 'abc123', // Promotion Campaign ID - Type: Srting
'promotion_name': 'summer_promo', // Promotion Campaign Name - Type: Srting
'creative_name': 'instore_suummer', // Promotion Creative Name - Type: Srting
'creative_slot': '1', // Promotion Creative Slot - Type: Numeric
'location_id': 'hero_banner', // Promotion Location - Type: Srting
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: view_promotion
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘view_promotion’


7. Promotion clicks
To measure promotion clicks details, we need to push the product and its attributes to the data layer and pass a ‘select_promotion’ event along with that data.
// Measure promotion Clicks
dataLayer.push({
'event': ' select_promotion ',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'promotion_id': 'abc123', // Promotion Campaign ID - Type: Srting
'promotion_name': 'summer_promo', // Promotion Campaign Name - Type: Srting
'creative_name': 'instore_suummer', // Promotion Creative Name - Type: Srting
'creative_slot': '1', // Promotion Creative Slot - Type: Numeric
'location_id': 'hero_banner', // Promotion Location - Type: Srting
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: select_promotion
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘select_promotion’


8. Checkouts
To measure checkout activity details, we need to push a product and its attributes to the data layer and pass a ‘begin_checkout’ event along with that data.
// Measure a Checkout
dataLayer.push({
'event': ' begin_checkout',
'ecommerce': {
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'index': 1, // Product List Position - Type: Numeric
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like below
- Tag type: GA4 event
- Event name: begin_checkout
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration.
- Trigger type: Custom event
- Trigger condition: event equals ‘begin_checkout’


9. Purchases
To measure purchases, we need to push transactions, products and their attributes to the data layer and pass a ‘purchase’ event along with that data on thank you page.
// Measure purchases
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'transaction_id': 'T12345', // Transaction ID- Type: String
'affiliation': 'Online Store', // Affliation - Type: String
'value': '35.25', // Product Price- Type: Numeric
'tax': '4.90', // Taxes If applicable- Type: Numeric
'shipping': '5.99', // Shipping Charges- Type: Numeric
'currency': 'EUR', // Currency- Type: Numeric
'coupon': 'SUMMER_SALE', // Coupan Code if applicable- Type: String
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: purchase
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration.
- Trigger type: Custom event
- Trigger condition: event equals ‘purchase’


10. Refunds
To measure refunds, we need to push transaction details to the data layer and pass a ‘refund’ event along with that data onto the thank you page.
// Measure Refunds
dataLayer.push({
'event': 'refund',
'ecommerce': {
'transaction_id': 'T12345', // Transaction ID- Type: String
}
});
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: refund
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘refund’


If you want to measure a partial refund, you can also pass a list of products with their attributes as below.
// Measure Refunds
dataLayer.push({
'event': 'refund',
'ecommerce': {
'transaction_id': 'T12345', // Transaction ID- Type: String
'items': [
{
'item_name': 'Sample Product 1', // Product Name- Type: String
'item_id': '123456', // Product ID/SKU- Type: String
'price': '35.25', // Product price - Type: numeric
'item_brand': 'Your Brand Name', //Product brand - Type: string
'item_category': 'Category Name', // Product category Main - Type: string
'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string
'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string
'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string
'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string
'quantity': '1' // Product quantity - Type: numeric
}]
}
});
The rest of the Google Tag Manager configuration and trigger configuration will remain the same.
So, that is how you can set up ecommerce tracking in Google Analytics 4.
Ecommerce reporting in GA4
Now that you have completed the ecommerce set-up for your GA4 property, you can wait some time to generate the data and proceed with the reporting interface.
To view ecommerce reports for your GA4 property, you can click on ‘Monetization’ in the reporting menu.


Then click on ‘Monetization Overview’.


You will get to see below trends and tables providing details like ‘Total Revenue’, ‘Total Buyers’ and ‘Avg. purchase revenue per user’.


If you want a more detailed report, click on ‘Ecommerce Purchases’ in the reporting menu.


You will get a detailed report like the one below.






You can also check the funnel report in the ‘Analysis’ tab by defining the funnel steps.
Note: You need to create a funnel. If you are new and don’t know how to use exploration reports and funnel reports, you can check this to understand more: How to Use the Exploration Report


This is how you can set up ecommerce tracking in a Google Analytics 4 property.
Update: New dimensions and metrics for ecommerce in GA4
GA4 has introduced new dimensions and metrics for ecommerce.
It also now provides an event-scoped and item-scoped version of ecommerce metrics and dimensions.
Event-scoped metrics measure the number of times an ecommerce event was triggered on your website/app.
For example,
‘Add to carts‘ is an event-scoped metric that measures the number of times users add items to a shopping cart.
This metric is populated by sending the add_to_cart event.
Item-scoped metrics measure the number of items users interacted with on your website/app.
For example,
‘Items added to cart‘ is an item-scoped metric that measures the number of items added to the cart.
This metric is populated by sending an items array with the add_to_cart event.
Just like GA4 ecommerce metrics, there are event-scoped and item-scoped dimensions.
“Item-scoped and event-scoped dimensions and metrics are incompatible with one another. Any time you use an item-scoped dimension, you must select an item-scoped metric rather than the equivalent event-scoped metric. The same applies to event-scoped dimensions and metrics.” – Google
The new ecommerce dimensions and metrics are found in exploration reports and the data API:
1) Item affiliation – The name or code of the affiliate associated with an item you sell.
2) Item variant – Like small, medium, large.
3) Items added to cart – number of items added to the cart.
4) Items checked out – number of items that were in the cart during checkout.
5) Items clicked in list – number of items clicked in a product list.
6) Items clicked in promotion – number of items clicked in a promotion.
7) Items viewed – number of items viewed.
8) Items viewed in list – number of items viewed in a product list.
9) Items viewed in promotion – number of items viewed in a promotion.
10) Shipping amount – the shipping amount associated with a transaction.
11) Shipping tier – different levels of shipping services offered by a company like standard, expedited, one-day delivery etc.
12) Tax amount – the tax amount associated with a transaction.
GA4 renamed the following ecommerce metrics:
- Add to carts (previously called Add-to-carts)
- Item-list click events (previously called Item list clicks)
- Item-list view events (previously called Item list views)
- Item view events (previously called Item views)
- Items purchased (previously called Item purchase quantity)
- Promotion clicks (previously called Item promotion clicks)
- Promotion views (previously called Item promotion views)
Other articles related to GA4 (Google Analytics 4)
#1 Google Analytics 4 Intro
- What is GA4 (Google Analytics 4) – The Apps + Web Property?
- Key Benefits of Using Google Analytics 4 (GA4)
- Setup GA4 – Upgrade to GA4 – Implementation Guide
- Google Analytics 4 (GA4) vs Universal Analytics – What is the Difference?
- GA4 vs GA4 360 – Pricing, Limits, Billing and More
- Google Analytics 4 Training & Tutorial with FREE GA4 ebook
#2 Google Analytics 4 Property
- Google Analytics Account Hierarchy (Structure Explained)
- Understanding Google Analytics Measurement ID (GA4)
- Google Signals GA4 – See Demographics (Gender, Age) in Google Analytics 4
- Using the GA4 (Google Analytics 4) Test Property
- Google Analytics 4 Sub Properties Tutorial
- Roll up Property in Google Analytics 4 (GA4) – Tutorial
#3 Google Analytics 4 Integrations
- How to connect GA4 (Google Analytics 4) with Google Data Studio
- How to link GA4 (Google Analytics 4) with Google Ads
- How to link Google Search Console to Google Analytics 4 (GA4)
- How to Install Google Analytics 4 on Shopify
- GA4 Firebase Integration – Correctly Add App Data Streams to GA4 Property
#4 Google Analytics 4 Events
- GA4 (Google Analytics 4) Event Tracking Setup Tutorial
- Understanding Event Parameters in Google Analytics 4 (GA4)
- Recommended Events in Google Analytics 4 (GA4)
- Enhanced Measurement Events in Google Analytics 4 (GA4)
- Automatically Collected Events in Google Analytics 4 (GA4)
- How to Set Up GA4 Custom Events via Google Tag Manager
- Events Report in Google Analytics 4 (GA4)
- How to Rename Events in Google Analytics 4 (GA4)
- How to Use Google Analytics 4 Event Builder
- GA4 Form Interactions Tracking – Enhanced Measurement
#5 Google Analytics 4 Conversions
- Google Analytics 4 Conversion Tracking Guide – GA4 Goals
- How to Import Conversions from GA4 Property to Your Google Ads account
- GA4 Conversion Rate – How to find it and use it
#6 Google Analytics 4 Dimensions
- GA4 (Google Analytics 4) Dimensions Tutorial
- GA4 (Google Analytics 4) Custom Dimensions Tutorial
- GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
- Event Scoped Custom Dimensions in GA4 – Tutorial
#7 Google Analytics 4 Metrics
- GA4 (Google Analytics 4) Metrics Tutorial with Free Google Analytics 4 Ebook
- GA4 (Google Analytics 4) Custom Metrics Tutorial
- What are Predictive Metrics in Google Analytics 4 (GA4)
#8 Google Analytics 4 Ecommerce
#9 Google Analytics 4 Specialized Tracking
- GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
- Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
- GA4 Site Search – Tracking Site Search in Google Analytics 4
- GA4 (Google Analytics 4) Scroll Tracking Tutorial
- Self-referral Google Analytics 4 – Referral exclusion GA4
- GA4 (Google Analytics 4) Data Import Tutorial
- Google Analytics 4 Content Grouping – Create Content Groups in GA4
- How to Track Single Page Apps in Google Analytics 4 (GA4)
- utm_source, utm_medium, utm_campaign Parameters – GA4 (Google Analytics 4)
- GA4 Form Tracking via Google Tag Manager
#10 Google Analytics 4 filters
- GA4 filters – Understanding Data Filters in Google Analytics 4
- How to Create and Test Filters in Google Analytics 4 (GA4)?
- Exclude Internal Traffic in GA4 (Google Analytics 4) via IP Filter
#11 Google Analytics 4 Explorations
- Free Form Report in GA4 (Google Analytics 4) – Exploration Report
- How to Use the User Lifetime Report in Google Analytics 4 (GA4)
- How to Use Path Exploration Report in GA4 (Google Analytics 4) – Path Analysis
- How to Use Segment Overlap Report in Google Analytics 4 (GA4)
- How to Use the Funnel Exploration Report in GA4 (Google Analytics 4) – Funnel Analysis
- Cohort Exploration Report in Google Analytics 4 (GA4)
- How to Create Landing Pages Report in GA4 (Google Analytics 4)
- How to Create Google Ads report in GA4 (Google Analytics 4)
- How to Segment GA4 Data by Data Stream
- Organic Search Traffic Analysis in GA4 – Complete Guide
- Google Analytics 4 (GA4) Outbound Links Tracking
- How to Track Email Campaigns and Traffic in GA4
- How to view full page URLs in GA4?
#12 Google Analytics 4 Advanced
- Understanding Google Analytics 4 Sessions
- GA4 (Google Analytics 4) Measurement Protocol Tutorial
- How to Build Comparisons (Advanced Segments) in Google Analytics 4 (GA4)
- Understanding Automated Insights in Google Analytics 4 (GA4)
- Understanding Channel Groupings in Google Analytics 4 (GA4)
- Understanding Data Sampling in Google Analytics 4 (GA4)
- Google Analytics 4 Regex (Regular Expressions) Tutorial
- Google analytics 4 GDPR compliance checklist
#13 Google Analytics 4 Reports
- How to Create Custom Insights in Google Analytics 4 (GA4)
- How to Use Debug View Report in Google Analytics 4 (GA4)
#14 Google Analytics 4 Attribution
- Guide to Attribution Models in GA4 (Google Analytics 4)
- How to Change Attribution Models in GA4 (Google Analytics 4)?
- GA4 (Google Analytics 4) Conversion Paths Report in Attribution
- GA4 (Google Analytics 4) Model Comparison Report in Attribution
- Advertising Snapshot in GA4 (Google Analytics 4) Attribution
- GA4 Attribution Modelling Tutorial
#15 Google Analytics 4 Audiences
- GA4 Audiences – Creating Custom Audience in Google Analytics 4
- How to Create a Remarketing Audience in Google Analytics 4 (GA4)
- Understanding Audience Triggers in Google Analytics 4 (GA4)
- Google Analytics 4 (GA4) Predictive Audiences – Tutorial
#16 Google Analytics 4 BigQuery
- GA4 BigQuery – Connect Google Analytics 4 with BigQuery
- BigQuery GA4 Schema – Send Custom GA4 Data to BigQuery
- How to Backfill GA4 Data in BigQuery
- How to Connect and Export Data from GA4 to BigQuery
Other articles on Google Analytics Ecommerce
- Google Analytics Ecommerce Tracking Tutorial
- Enhanced Ecommerce Tracking in Google Analytics – Tutorial
- Set up Enhanced Ecommerce Tracking in Google Analytics
- Using Enhanced Ecommerce segments for Remarketing in Google Analytics
- Using Cohort Analysis & Enhanced Ecommerce to Understand User Behavior
- Duplicate Transactions (orders) in Google Analytics
- Enhanced Ecommerce Tracking via Google Tag Manager
- Ecommerce Tracking Google Tag Manager (GTM) – Tutorial
- Shopify Enhanced Ecommerce Tracking in Google Analytics – Tutorial
- Why Google Analytics and Shopping Cart Sales data don’t match and how to fix it
- How to remove / modify Google Analytics ecommerce transaction in one click
- Tracking Google Analytics Paypal Referral and other payment gateways
- Subscription & Recurring Revenue Analytics in Google Analytics
- Understanding Google Analytics Product Data Import
- Shopping Cart Analytics Tutorial
- Learn To Read E-Commerce Reports In Google Analytics
- Dealing with Google Analytics Refund – Reverse Transaction
- How to reverse transactions in Google Analytics for gtag.js and analytics.js
- How to Fix Missing Ecommerce Data in Google Analytics
Last Updated: February 3, 2023
- Understanding Google Analytics 4 ecommerce tracking
- Setting up ecommerce tracking in Google Analytics 4 using Google Tag Manager
- 1. Product/item list views/impressions
- 2. Product/item list clicks
- 3. Product/item detail views
- 4. Add to cart
- 5. Remove from cart
- 6. Promotion views/impressions
- 7. Promotion clicks
- 8. Checkouts
- 9. Purchases
- 10. Refunds
- Ecommerce reporting in GA4
- Update: New dimensions and metrics for ecommerce in GA4
- Other articles related to GA4
- Other articles on Google Analytics Ecommerce
Understanding Google Analytics 4 ecommerce tracking
In this article, I will show you how to set up ecommerce tracking in Google Analytics 4 (GA4) using Google Tag Manager (GTM).
With Google Analytics 4 properties, ecommerce implementation is a bit different compared to the legacy version, also known as Universal Analytics.
I recommend following the developer’s documentation Ecommerce (GA4) Developer Guide alongside this article.
If we compare Google Analytics 4 vs Universal Analytics, there are a few similarities and differences, as below.
1) Schema changes
While setting up the ecommerce events, we need to pass the different schemas like product details, currency, promotions, etc.
For example, earlier in Universal Analytics, if we wanted to pass a product name, we used to pass it using ‘name’, but in the case of GA4, it is just ‘item_name’.
Another example,
If you want to measure a promotion (when a user clicks on any promotion link), in universal analytics, we used to pass this using ‘promoClick’, but in the case of GA4, it has now changed to ‘select_promotion’.
The table below will provide details on the different schemas and changes.
No | Google Analytics 4 | Universal Analytics | Description |
1 | view_promotion | promoView | When a user views a promotion |
2 | select_promotion | promoClick | When a user clicks on a promotion |
3 | view_item_list | impressions | View of product impressions in a list |
4 | select_item | productClick | Click on a product |
5 | view_item | detail | View product details |
6 | add_to_cart | addToCart | Add product to cart |
7 | add_to_wishlist | N/A | Add product to a wishlist |
8 | remove_from_cart | removeFromCart | Remove product from the cart |
9 | view_cart | N/A | View shopping cart |
10 | begin_checkout | checkout | Initiate the checkout process |
11 | add_shipping_info | checkout_option | Add shipping info during the checkout |
12 | add_payment_info | checkout_option | Add payment info during the checkout |
13 | purchase | purchase | Purchase product |
14 | refund | refund | Refund product |
15 | item_id | id | Product ID / SKU |
16 | item_name | name | Name of the product |
17 | item_list_name | list | Product list name |
18 | item_list_id | N/A | Product list identifier |
19 | index | position | Product position in the list |
20 | item_brand | brand | Product brand |
21 | item_category | category | Product category |
22 | item_category_2 | category | Product category 2nd level |
23 | item_category_3 | category | Product category 3rd level |
24 | item_category_4 | category | Product category 4th level |
25 | item_category_5 | category | Product category 5th level |
26 | item_variant | variant | Product variant name or description |
27 | affiliation | N/A | The store affiliation |
28 | discount | N/A | Any discount on product |
29 | coupon | coupon | Coupon code used |
30 | price | price | Product price |
31 | currency | N/A | User currency |
32 | quantity | quantity | Product quantity |
33 | promotion_id | id | Promotion ID |
34 | promotion_name | name | Promotion name |
35 | transaction_id | id | Unique ID for the transaction required for purchase and refund events |
36 | value | revenue | Product revenue |
37 | shipping | shipping | Shipping charges for selected product in the cart |
38 | payment_type | option | The payment method sent with add_payment_info |
2) Data layer implementation
You might be thinking of updating your data layer according to the new schemas, but wait!
If you are using Universal Analytics for your ecommerce website, do not update your current setup.
This is because the new schemas are not backwards compatible and hence can break your current (Universal Analytics) setup.
The good news is that most of the schemas are forward-compatible, and Google will translate your Universal Analytics events to the GA4 App + Web custom events.
The best thing to do to keep both versions of analytics active and running is to update your current setup to add GA4 App + web specific dataLayer and schemas along with current schemas.
This way, it won’t break your Universal Analytics, and the GA4 App + Web will also have its required schemas.
Now let’s get started with setting up ecommerce tracking in Google Analytics 4
Setting up ecommerce tracking in Google Analytics 4 using Google Tag Manager
Note: Ecommerce events can also be implemented using a global site tag (gtag.js). In our case, we will be using Google Tag Manager.
While implementing the ecommerce tracking, we need to define or modify our DataLayer on the page, and this needs development work to update the values.
If you are unfamiliar with the dev work, you can ask your developer to implement the DataLayer. Once the DataLayer is defined, you can configure the DataLayer variable in GTM.
Follow the below steps to create an ecommerce DataLayer variable.
Step 1: Log in to your Google Tag Manager console and click on ‘Variables’ in the left-hand side menu.


Step 2: Click on ‘New’.


Step 3: Give your variable a proper name and click ‘Variable Configuration’.


Step 4: An overlay will appear like the one below. Select the Data Layer variable.


Step 5: Variable configuration will open like below. Type ‘ecommerce.items’ as the Data Layer variable name.


Step 6: Click on ‘Save’.



Since our Data Layer variable is configured, we can proceed with implementing ecommerce events. We will be measuring the standard ecommerce events.
The section below will provide details of the DataLayer code, GTM tag configuration and trigger condition.
1. Product/item list views/impressions
This event will measure product impressions. We need to fire this tag on the pages where a list of products is displayed, generally on the home page, category pages, etc.
DataLayer configuration:
To measure item list views/impressions, we need to push a list of products and their attributes to the data layer and pass a ‘view_item_list’ event along with that data.
// Measure product views / impressions dataLayer.push({ 'event': 'view_item_list', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'item_list_name': 'Search Results', // Product List Name - Type: string 'item_list_id': 'SR12', // Product List ID - Type: string 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, the next step is to configure your tag. Follow the below steps to configure.
Step 1: Log in to your Google Tag Manager console and click on ‘Tags’ in the left-hand side menu.


Step 2: Click on ‘New’ to create a new scroll event tag for the GA4 property.


Step 3: Give a proper name to your tag and click on ‘Tag Configuration’.


Step 4: An overlay with a list of tag templates will appear on the right-hand side. Select ‘Google Analytics: GA4 Event’.


Step 5: Tag configuration window will open like below. Click on ‘Select Configuration Tag’.


Step 6: A drop-down menu will appear. You can either select your pageview tag or ‘None- Manually Set ID’ from the drop-down. We will select ‘None- Manually Set ID’ in our case.


Step 7: The next step is to enter the GA measurement ID in the input box.
Your measurement ID is in the admin section under ‘Data Streams’.




Step 8: Specify the name of the event. The event name you provide here will appear in your GA4 analytics reporting. Now give an event name as ‘view_item_list’.


Step 9: Click on the ‘Event Parameters‘ drop-down menu:


Step 10: Click on the ‘Add Row’ button:


You should now see the two new text boxes: ‘Parameter Name’ and ‘Value’.


Step 11: Type ‘items’ in the ‘Parameter Name’ text box.


Step 12: Click on the ‘+’ button under the ‘Value’ text box:


Step 13: An overlay will appear like the one below. Select the ‘GA4 Ecommerce DataLayer’ variable. This is the same variable that we created earlier.


Step 14: Your tag configuration will appear like the one below.


It’s done! Now let’s set up the trigger configuration.
Trigger Configuration:
Step 15: Click anywhere under ‘Triggering’.


Step 16: An overlay will appear like the one below. Click on the ‘+’ icon to add a new trigger.


Step 17: Give a proper name to your trigger and click anywhere in ‘Trigger Configuration’.


Step 18: An overlay will appear like the one below. Select ‘Custom Event’ from the list.


Step 19: ‘Trigger Configuration’ will open. In the input box, we need to provide the event name. In this event, it is ‘view_item_list’ since we are measuring product impressions. Type ‘view_item_list’ In the event name.


Step 20: Click on ‘Save’.



Your complete tag will look like the one below.


Congratulations!!! You have successfully created your first ecommerce event for your GA4 property.
Now let’s do this for the remaining ecommerce events.
Since I already showed you the step-by-step method to create it in the above event, I will now only show you the DataLayer code and final tag configuration and trigger configuration for the other events.
2. Product/item list clicks
DataLayer configuration:
To measure product clicks, we need to push the product and its attributes to the data layer and pass a ‘select_item’ event along with that data.
// Measure product Clicks dataLayer.push({ 'event': 'select_item', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'item_list_name': 'Search Results', // Product List Name - Type: string 'item_list_id': 'SR12', // Product List ID - Type: string 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: select_item
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘select_item’


3. Product/item detail views
To measure product views, we need to push the product and its attributes to the data layer and pass a ‘view_item’ event along with that data.
// Measure Product Detail View dataLayer.push({ 'event': 'view_item', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'item_list_name': 'Search Results', // Product List Name - Type: string 'item_list_id': 'SR12', // Product List ID - Type: string 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: view_item
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘view_item


4. Add to cart
To measure add to cart, we need to push the product and its attributes to the data layer and pass a ‘view_item’ event along with that data.
// Measure Add to Cart dataLayer.push({ 'event': ' add_to_cart', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'item_list_name': 'Search Results', // Product List Name - Type: string 'item_list_id': 'SR12', // Product List ID - Type: string 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: add_to_cart
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘add_to_cart’


5. Remove from cart
To measure remove from cart, we need to push a product and its attributes to the data layer and pass a ‘remove_from_cart’ event along with that data.
// Measure Remove From Cart dataLayer.push({ 'event': ' remove_from_cart', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'item_list_name': 'Search Results', // Product List Name - Type: string 'item_list_id': 'SR12', // Product List ID - Type: string 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: remove_from_cart
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration.
- Trigger type: Custom event
- Trigger condition: event equals ‘remove_from_cart’


6. Promotion views/impressions
You can measure both impressions and clicks on internal site promotions. These promotions include banners displayed on the site or an offer for free shipping.
To measure promotion view details, we need to push the product and its attributes to the data layer and pass a ‘view_promotion’ event along with that data.
// Measure promotion views/impressions dataLayer.push({ 'event': 'view_promotion', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'promotion_id': 'abc123', // Promotion Campaign ID - Type: Srting 'promotion_name': 'summer_promo', // Promotion Campaign Name - Type: Srting 'creative_name': 'instore_suummer', // Promotion Creative Name - Type: Srting 'creative_slot': '1', // Promotion Creative Slot - Type: Numeric 'location_id': 'hero_banner', // Promotion Location - Type: Srting 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: view_promotion
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘view_promotion’


7. Promotion clicks
To measure promotion clicks details, we need to push the product and its attributes to the data layer and pass a ‘select_promotion’ event along with that data.
// Measure promotion Clicks dataLayer.push({ 'event': ' select_promotion ', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'promotion_id': 'abc123', // Promotion Campaign ID - Type: Srting 'promotion_name': 'summer_promo', // Promotion Campaign Name - Type: Srting 'creative_name': 'instore_suummer', // Promotion Creative Name - Type: Srting 'creative_slot': '1', // Promotion Creative Slot - Type: Numeric 'location_id': 'hero_banner', // Promotion Location - Type: Srting 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: select_promotion
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘select_promotion’


8. Checkouts
To measure checkout activity details, we need to push a product and its attributes to the data layer and pass a ‘begin_checkout’ event along with that data.
// Measure a Checkout dataLayer.push({ 'event': ' begin_checkout', 'ecommerce': { 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'index': 1, // Product List Position - Type: Numeric 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like below
- Tag type: GA4 event
- Event name: begin_checkout
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration.
- Trigger type: Custom event
- Trigger condition: event equals ‘begin_checkout’


9. Purchases
To measure purchases, we need to push transactions, products and their attributes to the data layer and pass a ‘purchase’ event along with that data on thank you page.
// Measure purchases dataLayer.push({ 'event': 'purchase', 'ecommerce': { 'purchase': { 'transaction_id': 'T12345', // Transaction ID- Type: String 'affiliation': 'Online Store', // Affliation - Type: String 'value': '35.25', // Product Price- Type: Numeric 'tax': '4.90', // Taxes If applicable- Type: Numeric 'shipping': '5.99', // Shipping Charges- Type: Numeric 'currency': 'EUR', // Currency- Type: Numeric 'coupon': 'SUMMER_SALE', // Coupan Code if applicable- Type: String 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'quantity': '1' // Product quantity - Type: numeric }] } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 event
- Event name: purchase
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration.
- Trigger type: Custom event
- Trigger condition: event equals ‘purchase’


10. Refunds
To measure refunds, we need to push transaction details to the data layer and pass a ‘refund’ event along with that data onto the thank you page.
// Measure Refunds dataLayer.push({ 'event': 'refund', 'ecommerce': { 'transaction_id': 'T12345', // Transaction ID- Type: String } });
Google tag configuration:
Once the above code is pushed to the DataLayer, you can configure your Google Tag Manager tag like the one below.
- Tag type: GA4 Event
- Event name: refund
- Event parameter (name – value): ‘items’ – {{Ecommerce Items}}
- Variable type: data layer variable – ‘ecommerce.items’


Trigger configuration:
You can create a trigger with the below configuration
- Trigger type: Custom event
- Trigger condition: event equals ‘refund’


If you want to measure a partial refund, you can also pass a list of products with their attributes as below.
// Measure Refunds dataLayer.push({ 'event': 'refund', 'ecommerce': { 'transaction_id': 'T12345', // Transaction ID- Type: String 'items': [ { 'item_name': 'Sample Product 1', // Product Name- Type: String 'item_id': '123456', // Product ID/SKU- Type: String 'price': '35.25', // Product price - Type: numeric 'item_brand': 'Your Brand Name', //Product brand - Type: string 'item_category': 'Category Name', // Product category Main - Type: string 'item_category_2': 'Category level1', // Product category (Mens, Kids) - Type: string 'item_category_3': 'Category level2', // Product category (Shirts, Shoes) - Type: string 'item_category_4': 'Category level3', // Product category (T-shirt, Sport Shoes) - Type: string 'item_variant': 'Variant', // Variant of the product like color, size etc - Type: string 'quantity': '1' // Product quantity - Type: numeric }] } });
The rest of the Google Tag Manager configuration and trigger configuration will remain the same.
So, that is how you can set up ecommerce tracking in Google Analytics 4.
Ecommerce reporting in GA4
Now that you have completed the ecommerce set-up for your GA4 property, you can wait some time to generate the data and proceed with the reporting interface.
To view ecommerce reports for your GA4 property, you can click on ‘Monetization’ in the reporting menu.


Then click on ‘Monetization Overview’.


You will get to see below trends and tables providing details like ‘Total Revenue’, ‘Total Buyers’ and ‘Avg. purchase revenue per user’.


If you want a more detailed report, click on ‘Ecommerce Purchases’ in the reporting menu.


You will get a detailed report like the one below.






You can also check the funnel report in the ‘Analysis’ tab by defining the funnel steps.
Note: You need to create a funnel. If you are new and don’t know how to use exploration reports and funnel reports, you can check this to understand more: How to Use the Exploration Report


This is how you can set up ecommerce tracking in a Google Analytics 4 property.
Update: New dimensions and metrics for ecommerce in GA4
GA4 has introduced new dimensions and metrics for ecommerce.
It also now provides an event-scoped and item-scoped version of ecommerce metrics and dimensions.
Event-scoped metrics measure the number of times an ecommerce event was triggered on your website/app.
For example,
‘Add to carts‘ is an event-scoped metric that measures the number of times users add items to a shopping cart.
This metric is populated by sending the add_to_cart event.
Item-scoped metrics measure the number of items users interacted with on your website/app.
For example,
‘Items added to cart‘ is an item-scoped metric that measures the number of items added to the cart.
This metric is populated by sending an items array with the add_to_cart event.
Just like GA4 ecommerce metrics, there are event-scoped and item-scoped dimensions.
“Item-scoped and event-scoped dimensions and metrics are incompatible with one another. Any time you use an item-scoped dimension, you must select an item-scoped metric rather than the equivalent event-scoped metric. The same applies to event-scoped dimensions and metrics.” – Google
The new ecommerce dimensions and metrics are found in exploration reports and the data API:
1) Item affiliation – The name or code of the affiliate associated with an item you sell.
2) Item variant – Like small, medium, large.
3) Items added to cart – number of items added to the cart.
4) Items checked out – number of items that were in the cart during checkout.
5) Items clicked in list – number of items clicked in a product list.
6) Items clicked in promotion – number of items clicked in a promotion.
7) Items viewed – number of items viewed.
8) Items viewed in list – number of items viewed in a product list.
9) Items viewed in promotion – number of items viewed in a promotion.
10) Shipping amount – the shipping amount associated with a transaction.
11) Shipping tier – different levels of shipping services offered by a company like standard, expedited, one-day delivery etc.
12) Tax amount – the tax amount associated with a transaction.
GA4 renamed the following ecommerce metrics:
- Add to carts (previously called Add-to-carts)
- Item-list click events (previously called Item list clicks)
- Item-list view events (previously called Item list views)
- Item view events (previously called Item views)
- Items purchased (previously called Item purchase quantity)
- Promotion clicks (previously called Item promotion clicks)
- Promotion views (previously called Item promotion views)
Other articles related to GA4 (Google Analytics 4)
#1 Google Analytics 4 Intro
- What is GA4 (Google Analytics 4) – The Apps + Web Property?
- Key Benefits of Using Google Analytics 4 (GA4)
- Setup GA4 – Upgrade to GA4 – Implementation Guide
- Google Analytics 4 (GA4) vs Universal Analytics – What is the Difference?
- GA4 vs GA4 360 – Pricing, Limits, Billing and More
- Google Analytics 4 Training & Tutorial with FREE GA4 ebook
#2 Google Analytics 4 Property
- Google Analytics Account Hierarchy (Structure Explained)
- Understanding Google Analytics Measurement ID (GA4)
- Google Signals GA4 – See Demographics (Gender, Age) in Google Analytics 4
- Using the GA4 (Google Analytics 4) Test Property
- Google Analytics 4 Sub Properties Tutorial
- Roll up Property in Google Analytics 4 (GA4) – Tutorial
#3 Google Analytics 4 Integrations
- How to connect GA4 (Google Analytics 4) with Google Data Studio
- How to link GA4 (Google Analytics 4) with Google Ads
- How to link Google Search Console to Google Analytics 4 (GA4)
- How to Install Google Analytics 4 on Shopify
- GA4 Firebase Integration – Correctly Add App Data Streams to GA4 Property
#4 Google Analytics 4 Events
- GA4 (Google Analytics 4) Event Tracking Setup Tutorial
- Understanding Event Parameters in Google Analytics 4 (GA4)
- Recommended Events in Google Analytics 4 (GA4)
- Enhanced Measurement Events in Google Analytics 4 (GA4)
- Automatically Collected Events in Google Analytics 4 (GA4)
- How to Set Up GA4 Custom Events via Google Tag Manager
- Events Report in Google Analytics 4 (GA4)
- How to Rename Events in Google Analytics 4 (GA4)
- How to Use Google Analytics 4 Event Builder
- GA4 Form Interactions Tracking – Enhanced Measurement
#5 Google Analytics 4 Conversions
- Google Analytics 4 Conversion Tracking Guide – GA4 Goals
- How to Import Conversions from GA4 Property to Your Google Ads account
- GA4 Conversion Rate – How to find it and use it
#6 Google Analytics 4 Dimensions
- GA4 (Google Analytics 4) Dimensions Tutorial
- GA4 (Google Analytics 4) Custom Dimensions Tutorial
- GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
- Event Scoped Custom Dimensions in GA4 – Tutorial
#7 Google Analytics 4 Metrics
- GA4 (Google Analytics 4) Metrics Tutorial with Free Google Analytics 4 Ebook
- GA4 (Google Analytics 4) Custom Metrics Tutorial
- What are Predictive Metrics in Google Analytics 4 (GA4)
#8 Google Analytics 4 Ecommerce
#9 Google Analytics 4 Specialized Tracking
- GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
- Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
- GA4 Site Search – Tracking Site Search in Google Analytics 4
- GA4 (Google Analytics 4) Scroll Tracking Tutorial
- Self-referral Google Analytics 4 – Referral exclusion GA4
- GA4 (Google Analytics 4) Data Import Tutorial
- Google Analytics 4 Content Grouping – Create Content Groups in GA4
- How to Track Single Page Apps in Google Analytics 4 (GA4)
- utm_source, utm_medium, utm_campaign Parameters – GA4 (Google Analytics 4)
- GA4 Form Tracking via Google Tag Manager
#10 Google Analytics 4 filters
- GA4 filters – Understanding Data Filters in Google Analytics 4
- How to Create and Test Filters in Google Analytics 4 (GA4)?
- Exclude Internal Traffic in GA4 (Google Analytics 4) via IP Filter
#11 Google Analytics 4 Explorations
- Free Form Report in GA4 (Google Analytics 4) – Exploration Report
- How to Use the User Lifetime Report in Google Analytics 4 (GA4)
- How to Use Path Exploration Report in GA4 (Google Analytics 4) – Path Analysis
- How to Use Segment Overlap Report in Google Analytics 4 (GA4)
- How to Use the Funnel Exploration Report in GA4 (Google Analytics 4) – Funnel Analysis
- Cohort Exploration Report in Google Analytics 4 (GA4)
- How to Create Landing Pages Report in GA4 (Google Analytics 4)
- How to Create Google Ads report in GA4 (Google Analytics 4)
- How to Segment GA4 Data by Data Stream
- Organic Search Traffic Analysis in GA4 – Complete Guide
- Google Analytics 4 (GA4) Outbound Links Tracking
- How to Track Email Campaigns and Traffic in GA4
- How to view full page URLs in GA4?
#12 Google Analytics 4 Advanced
- Understanding Google Analytics 4 Sessions
- GA4 (Google Analytics 4) Measurement Protocol Tutorial
- How to Build Comparisons (Advanced Segments) in Google Analytics 4 (GA4)
- Understanding Automated Insights in Google Analytics 4 (GA4)
- Understanding Channel Groupings in Google Analytics 4 (GA4)
- Understanding Data Sampling in Google Analytics 4 (GA4)
- Google Analytics 4 Regex (Regular Expressions) Tutorial
- Google analytics 4 GDPR compliance checklist
#13 Google Analytics 4 Reports
- How to Create Custom Insights in Google Analytics 4 (GA4)
- How to Use Debug View Report in Google Analytics 4 (GA4)
#14 Google Analytics 4 Attribution
- Guide to Attribution Models in GA4 (Google Analytics 4)
- How to Change Attribution Models in GA4 (Google Analytics 4)?
- GA4 (Google Analytics 4) Conversion Paths Report in Attribution
- GA4 (Google Analytics 4) Model Comparison Report in Attribution
- Advertising Snapshot in GA4 (Google Analytics 4) Attribution
- GA4 Attribution Modelling Tutorial
#15 Google Analytics 4 Audiences
- GA4 Audiences – Creating Custom Audience in Google Analytics 4
- How to Create a Remarketing Audience in Google Analytics 4 (GA4)
- Understanding Audience Triggers in Google Analytics 4 (GA4)
- Google Analytics 4 (GA4) Predictive Audiences – Tutorial
#16 Google Analytics 4 BigQuery
- GA4 BigQuery – Connect Google Analytics 4 with BigQuery
- BigQuery GA4 Schema – Send Custom GA4 Data to BigQuery
- How to Backfill GA4 Data in BigQuery
- How to Connect and Export Data from GA4 to BigQuery
Other articles on Google Analytics Ecommerce
- Google Analytics Ecommerce Tracking Tutorial
- Enhanced Ecommerce Tracking in Google Analytics – Tutorial
- Set up Enhanced Ecommerce Tracking in Google Analytics
- Using Enhanced Ecommerce segments for Remarketing in Google Analytics
- Using Cohort Analysis & Enhanced Ecommerce to Understand User Behavior
- Duplicate Transactions (orders) in Google Analytics
- Enhanced Ecommerce Tracking via Google Tag Manager
- Ecommerce Tracking Google Tag Manager (GTM) – Tutorial
- Shopify Enhanced Ecommerce Tracking in Google Analytics – Tutorial
- Why Google Analytics and Shopping Cart Sales data don’t match and how to fix it
- How to remove / modify Google Analytics ecommerce transaction in one click
- Tracking Google Analytics Paypal Referral and other payment gateways
- Subscription & Recurring Revenue Analytics in Google Analytics
- Understanding Google Analytics Product Data Import
- Shopping Cart Analytics Tutorial
- Learn To Read E-Commerce Reports In Google Analytics
- Dealing with Google Analytics Refund – Reverse Transaction
- How to reverse transactions in Google Analytics for gtag.js and analytics.js
- How to Fix Missing Ecommerce Data in Google Analytics
Register for the FREE TRAINING...
"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."
Here’s what we’re going to cover in this training…
#1 Why digital analytics is the key to online business success.
#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.
#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.
#4 Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.
#5 The number 1 reason why conversion optimization is not working for your business.
#6 How to advertise on any marketing platform for FREE with an unlimited budget.
#7 How to learn and master digital analytics and conversion optimization in record time.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.