Sub topic 2
The Recommended E-commerce Events and the Shopping Funnel
This chapter assumes that you know the basic GA4 interface, JavaScript objects and arrays, JSON, and the usual pages in an online shop. You will use that knowledge to map shopping actions to GA4’s recommended e-commerce events.
GA4 records e-commerce activity as events. Each event has a name and parameters. Most shopping events also include an items array, which describes the products involved. The event name tells GA4 what happened. The parameters provide details such as product IDs, quantities, currency, and value.
Mapping the shopping journey
A typical shopping funnel uses these events:
| Shopping action | GA4 event | Main purpose |
|---|---|---|
| Product list appears | `view_item_list` | Records products shown in a list |
| Shopper selects a product | `select_item` | Records a product selection |
| Product detail appears | `view_item` | Records a product detail view |
| Product enters the cart | `add_to_cart` | Records an addition to the cart |
| Cart is displayed | `view_cart` | Records a cart view |
| Checkout starts | `begin_checkout` | Records the start of checkout |
| Shipping or payment is submitted | `add_shipping_info`, `add_payment_info` | Records checkout steps |
| Order is completed | `purchase` | Records a completed transaction |
These events describe a recommended sequence, not a rule that every shopper must follow. A shopper may open a product page directly, skip a list, or return to the cart several times. Send an event when the corresponding action actually occurs.
What to send with each event
For product-related events, send an items array. Each item should contain a stable product identifier and enough information to identify the product in reports. Common fields include item_id, item_name, price, quantity, item_brand, item_category, and item_variant.
For events involving money, send currency as a three-letter ISO 4217 code, such as USD, and send value as a number. Calculate value consistently from the products involved. For example, two products priced at 24.99 produce a value of 49.98 before separately reported tax or shipping.
Use remove_from_cart when a shopper removes products. Do not send add_to_cart merely because a cart page loads. The event should represent the action, not the page display.
Why the sequence matters
The funnel lets GA4 compare product discovery, cart activity, checkout progress, and completed orders. Missing or incorrectly named events break those comparisons. A purchase event without reliable item data can still record revenue, but item-level reports and product conversion analysis will be incomplete.
Exercise
Which event should you send when a product detail page becomes visible, and which event should you send when the shopper adds that product to the cart?
Show answer
Send view_item when the product detail is viewed and add_to_cart when the shopper adds the product.