GA4 Ecommerce Events Builder

Build GA4 ecommerce event code with a visual form. Generates dataLayer.push() and gtag() snippets.

⚙ Event Configuration
Output Format
Event Parameters

Select an event type above to configure parameters.

📦 Items Array

No items added yet. Click + Add Item to add a product.
dataLayer.push()
🛒Select an event and add items to
generate your ecommerce code.

What Are GA4 Ecommerce Events?

GA4 ecommerce events are a set of recommended events defined by Google that track the entire shopping journey on your website. From browsing product lists to completing a purchase, these events feed data into GA4’s built-in Monetization reports, giving you a clear view of revenue, conversion rates, and product performance.

Unlike Universal Analytics, which used a separate Enhanced Ecommerce plugin, GA4 treats ecommerce tracking as native recommended events. Each event carries an items array containing product details (name, ID, price, category, etc.) along with event-level parameters like currency, value, and transaction_id.

Implementing these events correctly unlocks GA4’s Monetization reports, Funnel Exploration templates, and audience building based on purchase behavior. Skipping even one event in the funnel means gaps in your data and missed optimization opportunities.

GA4 Ecommerce Event Flow

The GA4 ecommerce funnel follows a user’s journey from product discovery through to purchase. Each step is an event you can track:

📑
view_item_list
Browse category
👉
select_item
Click product
🔎
view_item
Product detail page
🛒
add_to_cart
Add product
🛍
view_cart
Review cart
💳
begin_checkout
Start checkout
🚚
add_shipping_info
Shipping details
💳
add_payment_info
Payment method
purchase
Order complete

Event Parameters Reference

Each GA4 ecommerce event supports specific parameters. The table below shows which parameters are required, recommended, or optional for each event.

Event Required Parameters Recommended Parameters
view_item_list items[] item_list_id, item_list_name
select_item items[] item_list_id, item_list_name
view_item items[], currency, value
add_to_wishlist items[], currency, value
add_to_cart items[], currency, value
remove_from_cart items[], currency, value
view_cart items[], currency, value
begin_checkout items[], currency, value coupon
add_shipping_info items[], currency, value coupon, shipping_tier, shipping
add_payment_info items[], currency, value coupon, payment_type
purchase items[], currency, value, transaction_id coupon, shipping, tax, affiliation
refund transaction_id items[], currency, value, coupon, shipping, tax

Ecommerce Tracking Best Practices

✅ DO
  • Clear the ecommerce object before each push: { ecommerce: null }
  • Always include currency and value together
  • Use unique transaction_id values to prevent duplicate purchases
  • Include item_id and item_name for every item
  • Test events in GA4 DebugView before going live
  • Keep item_category consistent across all events in the funnel
❌ DON’T
  • Don’t fire purchase on page reload without deduplication
  • Don’t mix currency formats (send “USD”, not “$”)
  • Don’t exceed 200 items per event (GA4 limit is 200)
  • Don’t forget to include items[] array in product events
  • Don’t use different item_id formats across events
  • Don’t send value as a string; it must be a number

Frequently Asked Questions

No. You should implement the events that match your user journey. At a minimum, most stores track view_item, add_to_cart, begin_checkout, and purchase. However, the more events you implement, the richer your funnel analysis will be in GA4’s Monetization reports.

The dataLayer.push() method is used when you have Google Tag Manager (GTM) installed. GTM reads from the dataLayer and forwards events to GA4 via tags you configure. The gtag() method sends events directly to GA4 without GTM. If you use GTM for tag management, choose dataLayer; if you use the GA4 script directly (gtag.js), use the gtag() format.

The dataLayer is a persistent array. If a previous ecommerce event left data in the ecommerce object, it could merge with your new event and corrupt the data. Pushing { ecommerce: null } before each ecommerce event ensures a clean slate. This is a Google-recommended best practice and prevents hard-to-debug data quality issues.

Use GA4’s DebugView (Admin > DebugView) along with the Google Analytics Debugger Chrome extension. Enable debug mode by adding debug_mode: true to your event configuration. You can also use Google Tag Manager’s Preview mode to see dataLayer pushes in real time and verify the event structure before publishing.

Yes. GA4 allows custom parameters on any event. For ecommerce events, you can add custom item-level parameters (e.g., item_color, item_size) or event-level parameters. However, custom parameters must be registered as custom dimensions or metrics in GA4’s admin to appear in reports. Stick to Google’s recommended parameter names when possible for automatic report integration.

GA4 uses transaction_id to deduplicate purchase events. If you send the same transaction_id multiple times (e.g., on a thank-you page refresh), GA4 should count it only once. However, this deduplication is not guaranteed in real-time reports and works best in processed data. Always implement client-side deduplication (e.g., a flag in sessionStorage) as an additional safeguard.