Updated: March 16, 2026
If you run an online store and you’ve set up GA4, you might have noticed something frustrating: GA4 shows you pageviews and user counts, but it doesn’t tell you what actually matters — which products people are viewing, what they’re adding to their carts, and whether they’re actually buying anything. Without e-commerce tracking, you’re flying blind.
That’s where GA4’s built-in e-commerce measurement model comes in. It gives you a standardized way to track the full user journey, from product discovery all the way to purchase (and even refunds). In this guide, I’ll walk you through every recommended e-commerce event and show you the exact gtag.js code you need to implement them.
If you haven’t installed GA4 yet, start here: Installing Google Analytics 4 with gtag.js
Product Views
These events track how users discover and interact with products on your site. Think of them as the “top of the funnel” for your e-commerce data.
view_item_list
Fires when a user sees a list of products — category pages, search results, recommended products, you name it. This event helps you understand which product lists are driving engagement.
gtag("event", "view_item", {
currency: "USD",
value: 7.77,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
view_item
Fires when a user opens a product detail page. This is one of the most important events because it tells you which products are getting serious consideration.
gtag("event", "select_item", {
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
select_item
Fires when a user clicks on a product from a list (but hasn’t yet landed on the detail page). This is the bridge between browsing and considering.
gtag("event", "select_item", {
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
Internal Promotion
These events track internal marketing promotions — banners, featured products, or seasonal campaigns displayed on your own site. Not to be confused with external ad campaigns.
view_promotion
Fires when a user sees a promotion on your site.
gtag("event", "view_promotion", {
creative_name: "Summer Banner",
creative_slot: "featured_app_1",
location_id: "L_12345",
promotion_id: "P_12345",
promotion_name: "Summer Sale"
});
select_promotion
Fires when a user clicks on a promotion.
gtag("event", "select_promotion", {
creative_name: "Summer Banner",
creative_slot: "featured_app_1",
location_id: "L_12345",
promotion_id: "P_12345",
promotion_name: "Summer Sale"
});
Shopping Cart
These events track the critical moment when a user moves from browsing to intent.
add_to_cart
Fires when a user adds a product to their shopping cart.
gtag("event", "add_to_cart", {
currency: "USD",
value: 7.77,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
remove_from_cart
Fires when a user removes a product from their shopping cart. This event is often overlooked, but it’s gold for identifying friction points in your checkout flow.
gtag("event", "remove_from_cart", {
currency: "USD",
value: 7.77,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
Checkout
Here’s where the checkout funnel events live. These are the events that help you figure out exactly where people are dropping off in the purchase process.
Important: Whenever you send revenue-related data (the value parameter), always include the currency parameter too. Without it, GA4 won’t know how to interpret the number, and your revenue metrics will be meaningless.
begin_checkout
Fires when a user starts the checkout process.
gtag("event", "begin_checkout", {
currency: "USD",
value: 7.77,
coupon: "SUMMER_FUN",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
add_payment_info
Fires when a user submits their payment information.
gtag("event", "add_payment_info", {
currency: "USD",
value: 7.77,
coupon: "SUMMER_FUN",
payment_type: "Credit Card",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
add_shipping_info
Fires when a user selects their shipping method.
gtag("event", "add_shipping_info", {
currency: "USD",
value: 7.77,
coupon: "SUMMER_FUN",
shipping_tier: "Ground",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
purchase
This is the big one — fires when a user completes a purchase. Make sure your transaction_id is unique; sending a duplicate will cause GA4 to ignore the event.
gtag("event", "purchase", {
transaction_id: "T_12345",
affiliation: "Google Merchandise Store",
value: 36.32,
tax: 4.90,
shipping: 5.99,
currency: "USD",
coupon: "SUMMER_SALE",
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
},
{
Product2
}]
});
refund
The refund event lets you send refund data back to GA4 so your revenue numbers stay accurate. You can send either a partial refund (with specific items) or a full refund (just the transaction ID and total value).
Partial refund
gtag("event", "refund", {
currency: "USD",
transaction_id: "T_12345",
value: 12.21,
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
shipping: 3.33,
tax: 1.11,
items: [
{
item_id: "SKU_12345",
item_name: "Stan and Friends Tee",
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
currency: "USD",
discount: 2.22,
index: 0,
item_brand: "Google",
item_category: "Apparel",
item_category2: "Adult",
item_category3: "Shirts",
item_category4: "Crew",
item_category5: "Short sleeve",
item_list_id: "related_products",
item_list_name: "Related Products",
item_variant: "green",
location_id: "L_12345",
price: 9.99,
quantity: 1
}
]
});
Full refund
gtag("event", "refund", {
currency: "USD",
transaction_id: "T_12345",
value: 12.21,
affiliation: "Google Merchandise Store",
coupon: "SUMMER_FUN",
shipping: 3.33,
tax: 1.11
});
Final Words
That covers all the core e-commerce events in GA4 with gtag.js. The good news is that once you have these events in place, GA4 will automatically populate a ton of reports — product performance, shopping behavior, checkout behavior, purchase journey, and more — without any extra configuration.
A few things to keep in mind:
- Use consistent
item_id values across all events. If your product has SKU SKU_12345 in view_item, use the same ID in add_to_cart and purchase. Mismatched item IDs = messy data.
- Include
currency whenever you include value. I know I mentioned it earlier, but it’s worth repeating — GA4 silently drops revenue data that’s missing a currency.
- Make
transaction_id unique. Duplicate transaction IDs will be treated as duplicate conversions, and GA4 will ignore the second one. Good for data quality, but be careful if you’re sending events multiple times by accident.