Lesson 5 of 8
The Events And Their GA4 Mapping
Once events are landing in the dataLayer, the work is mapping Shopify's names and fields onto GA4's. Shopify publishes the canonical mapping, and following it keeps your ecommerce reports correct.
Event → GA4 event
product_viewed→view_itemproduct_added_to_cart→add_to_cartcart_viewed→view_cartcheckout_started→begin_checkoutpayment_info_submitted→add_payment_infocheckout_completed→purchase
Field → GA4 parameter (on checkout_completed)
checkout.order.id→transaction_idcheckout.totalPrice.amount→valuecheckout.currencyCode→currencycheckout.shippingLine.price.amount→shippingcheckout.totalTax.amount→taxcheckout.discountApplications→couponcheckout.lineItems→items(needs reshaping)
The one field that isn't a straight rename is lineItems: GA4's items array wants item_id, item_name, price, quantity, so you map each Shopify line item into that shape (often in the pixel, or in a Custom JS variable in GTM).
items: event.data.checkout.lineItems.map((li) => ({
item_id: li.variant?.sku || li.variant?.product?.id,
item_name: li.title,
price: li.variant?.price?.amount,
quantity: li.quantity,
}))Key takeaway
Follow Shopify's published mapping: each event maps to a GA4 event and each field to a GA4 parameter. Most are renames; lineItems is the exception and must be reshaped into GA4's items array.