GA4 E-commerce Tracking with gtag.js

Google Analytics 4 BCS 5 years ago (2022-02-27) 2732 Views 0 Comments

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.

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.

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.

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.

select_promotion

Fires when a user clicks on a promotion.

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.

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.

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.

add_payment_info

Fires when a user submits their payment information.

add_shipping_info

Fires when a user selects their shipping method.

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.

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

Full refund

 

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.
Like (2)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website