← All example articles

Example article · How to Guide

How to Set Up GA4 Conversion Tracking for an E-commerce Store

Written by ProofWrite and published here as generated, without human edits, so you can judge the output with its receipts.

The receipts

Sources listed
10
Sources linked in the text
3
Sections
9
Words
2,809

Counted from the article file below. The full source list is at the end of the article.

How to Set Up GA4 Conversion Tracking for an E-commerce Store

Transitioning your e-commerce tracking from the legacy Universal Analytics system to Google Analytics 4 is not just a routine software update; it represents a fundamental shift in how your store's revenue is attributed and analyzed. Universal Analytics relied heavily on session-based hits and rigid goal completions. Google Analytics 4 operates on a flexible, event-based model where every single user interaction—from viewing a product to completing a checkout—is processed as an independent event.

This architectural change requires a new approach to implementation. Setting up GA4 conversion tracking correctly provides the technical roadmap to instrumenting your storefront with the precision required to calculate Return on Ad Spend (ROAS) accurately. When your event data is structured properly, you can identify your customers’ purchasing habits and optimize the customer experience to boost sales. A pristine data setup allows you to use GA4’s predictive machine learning capabilities, which can calculate purchase probability, forecast revenue, and identify churn probability among your user base.

This guide walks you through the sequential technical setup of accounts, platform integrations, and event tagging required to ensure your e-commerce tracking captures every critical data point along the customer journey.

What Are the Prerequisites for E-commerce Tracking?

Before you begin configuring tags or writing code, you must ensure you have the correct administrative access and accounts established. Implementing e-commerce events requires adding the Google tag to your website, which means you need uninterrupted access to your analytics platforms and your website's source code or content management system.

To successfully start e-commerce tracking, verify that you have the following prerequisites in place:

  • Google Account Verification: You need a valid Google account to use Google Analytics and Google Tag Manager. Ensure this account has administrative privileges.
  • Google Analytics Account: You must have an active Google Analytics account where your new GA4 property will reside.
  • Google Tag Manager Account: If you choose the tag management route (which is highly recommended for e-commerce), you need an active GTM container installed on your website.
  • Storefront Admin Access: You need administrative access to your e-commerce platform (such as Shopify, BigCommerce, or Adobe Commerce) to install native apps or inject tracking scripts.
  • Source Code Access: If you are running a custom-built store, you need developer access to the website's source code to manually push e-commerce data into the data layer.

Gathering these credentials beforehand prevents implementation delays. The following instructions walk you through the process of configuring your Google accounts, configuring your commerce store, and creating the necessary tags to capture revenue data.

Step 1: Create and Configure Your GA4 Property

Establishing your Google Analytics 4 property is the foundational step. Before you can start gathering data about your store, you need to create the environment where that data will be processed and stored.

Begin by navigating to the Admin section of your Google Analytics account. Under the Account column, click "Create Property." You will be prompted to name your property—typically your store's name—and select your reporting time zone and currency.

Setting the correct currency at this stage is a critical requirement. If your store processes transactions in US dollars, ensure the property currency is set to USD. If the currency sent in your e-commerce events does not match your property settings, GA4 will attempt to convert the value based on daily exchange rates, which can lead to frustrating discrepancies between your storefront revenue and your analytics reports.

Once the property is created, you must set up a Web Data Stream. This stream acts as the collection point for your website's data.

  1. Select "Web" as your platform.
  2. Enter your store's primary URL and name the stream.
  3. Leave Enhanced Measurement enabled, as it automatically captures helpful baseline events like page views, outbound clicks, and site search.
  4. Click "Create stream."

Upon creating the stream, Google Analytics will generate a unique Tag ID (formatted asG-XXXXXXXXXX). Make a note of this Tag ID because you will use it extensively in the following steps to link your storefront to this specific data stream. This identifier ensures that when a customer completes a purchase, the revenue data is routed exactly to your new property.

Step 2: Select Your Implementation Method (GTM vs. gtag. js)

With your property created, you must decide how the tracking code will be deployed on your website. You generally have two paths: using Google Tag Manager (GTM) or hard-coding the global site tag (gtag.js) directly into your website's source code.

Choosing the right implementation method dictates how you will manage tracking updates in the future.

Google Tag Manager (GTM)

For e-commerce stores, Google Tag Manager is the superior choice. GTM acts as a middleman between your website and your analytics platforms. Instead of writing complex JavaScript directly into your site's templates every time you want to track a new button click, you configure tags within the GTM interface.

More importantly, GTM relies on adataLayer—a JavaScript object that temporarily holds structured data about the user's interaction. When a user views a product, your website pushes the product's ID, name, and price into the data layer. GTM reads this data layer and forwards the exact values to GA4.

According to a complete technical guide by Simo Ahava, this implementation places a lot of responsibility on accurate tagging and proper data layer instrumentation, but it offers unmatched flexibility. If you ever need to send that same purchase data to Google Ads or a third-party marketing tool, GTM can reuse the existing data layer without requiring new code on your website.

Direct Implementation (gtag. js)

The alternative is adding thegtag.jsSnippet directly to your website's header and manually coding event triggers on every relevant page and button. While this might seem simpler initially for a very basic, single-product website, it quickly becomes unmanageable for a full e-commerce catalog. Every time you want to adjust how a product is tracked, a developer must edit the live website code.

Unless you have a specific technical restriction preventing the use of a tag management system, proceed with Google Tag Manager to ensure your setup remains scalable as your store grows.

Step 3: Execute Platform-Specific Integration

If you operate on a major hosted e-commerce platform, you may not need to manually code your data layer. Many modern platforms offer native integrations that automatically format and send e-commerce data to GA4. Events are built into the storefront, and event data is automatically sent to Google when you set up the integration.

Shopify Integration

For Shopify merchants, the process is highly simpler. The official Shopify help center guide details how to use the Google & YouTube channel app to handle the integration natively.

  1. Install the Google & YouTube app from the Shopify App Store.
  2. Connect your verified Google account.
  3. Select the GA4 property you created in Step 1. Once connected, Shopify automatically pushes core e-commerce events—such as product views, cart additions, and purchases—directly to GA4. You do not need to manually configure GTM for these basic events, though you can still use GTM alongside it for custom tracking needs.

BigCommerce Integration

BigCommerce also provides a smooth connection. According to the official platform documentation for BigCommerce, you can Navigate to Settings > Data Solutions within your store admin. Select Google Analytics 4, paste yourG-XXXXXXXXXXTag ID, and save. The platform automatically handles the data layer formatting and triggers the necessary e-commerce events during the shopping experience.

Adobe Commerce (Magento) Integration

For Adobe Commerce, the setup requires a bit more configuration. You must configure the GTM container within the admin panel. Navigate to Stores > Configuration > Sales > Google API. Here, you will input your GTM Container ID (formatted asGTM-XXXXXXX). Adobe Commerce will then output a structured data layer on your category, product, and checkout pages. You must then log into your GTM account and create the specific GA4 event tags that read this data layer and forward the information to your GA4 property.

Utilizing these automatically tracked e-commerce events simplifies the setup process significantly. After you set up Google Analytics 4 tags through these native apps, certain e-commerce events are tracked automatically, allowing you to focus on analyzing the data rather than debugging code.

Step 4: Start Recommended E-commerce Events

If you are using a custom-built store or a platform without a native GA4 integration, you must manually start the recommended e-commerce events. GA4 tracks everything as events—page views, button clicks, purchases, and form submissions. However, to populate the built-in Monetization reports, you must use Google's exact recommended event names.

Using custom event names (likeuser_bought_item Instead of purchase) will result in GA4 treating the action as a generic event, and your revenue dashboards will remain empty.

To consistently scale your campaigns and optimize ROAS, it is important to track every step of the customer journey with precision. Start the following core events:

  • view_item: Fires when a user views a specific product details page.
  • view_item_list: Fires when a user views a category page or a list of search results.
  • add_to_cart: Fires when a user adds a product to their shopping cart.
  • view_cart: Fires when a user navigates to the cart review page.
  • begin_checkout: Fires when the user starts the checkout process.
  • add_shipping_info: Fires when the user selects a shipping method.
  • add_payment_info: Fires when the user submits their payment details.
  • purchase: The most critical event, firing on the final order confirmation page.

Every single one of these e-commerce events must include anitems Array parameter containing the displayed items. TheitemsArray is a structured list that tells GA4 exactly which products were involved in the event. If a user buys three different shirts, thepurchaseEvent fires once, but the itemsArray inside that event will contain three distinct product objects, each detailing the specific shirt's ID, name, price, and quantity.

Required E-commerce Parameters and Schema

To ensure your data is processed correctly, your events must follow a strict schema. According to official Google developer documentation, recommendations for implementation include setting all available e-commerce parameters to guarantee accurate reporting.

The table below outlines the required and highly recommended parameters for thepurchaseEvent, which serves as the template for most e-commerce tracking.

Parameter Name Scope Requirement Description
transaction_id Event Required A unique identifier for the order (e. g., "ORD-12345"). Prevents duplicate tracking if the user refreshes the confirmation page.
value Event Required The total revenue of the transaction, including tax and shipping.
currency Event Required The 3-letter ISO 4217 currency code (e. g., "USD").
items Event Required An array containing individual item objects.
item_id Item Required* The unique SKU or product ID. (*Either item_id or item_name is strictly required).
item_name Item Required* The name of the product.
price Item Recommended The unit price of a single item.
quantity Item Recommended The number of units purchased for this specific item.

When constructing your data layer or writing yourgtag.jsCode, the payload for a purchase must look structurally similar to this example command:

gtag('event', 'purchase', {
  transaction_id: "T_12345",
  value: 120.50,
  currency: "USD",
  tax: 8.50,
  shipping: 12.00,
  items: [
    {
      item_id: "SKU_123",
      item_name: "Cotton T-Shirt",
      item_category: "Apparel",
      price: 25.00,
      quantity: 2
    },
    {
      item_id: "SKU_456",
      item_name: "Denim Jeans",
      item_category: "Apparel",
      price: 70.50,
      quantity: 1
    }
  ]
});

Failing to structure theitemsArray exactly as shown will result in GA4 dropping the product-level data, meaning you will see total revenue, but you will not know which products were actually sold.

Step 5: Verify Data Accuracy with DebugView

How do you know if your tracking is actually working before you launch it to the public? You must validate your setup using GA4's DebugView and Google Tag Manager's Preview mode. Relying solely on the standard real-time reports is insufficient for technical debugging because standard reports do not show the granular parameter data needed to verify theitemsArray.

Recommendations for implementation include enabling debug mode to inspect the exact payloads being sent to Google's servers.

  1. Open Google Tag Manager and click "Preview" in the top right corner.
  2. Enter your store's URL to launch the Tag Assistant window.
  3. In a separate tab, open your GA4 property and Navigate to Admin > Data display > DebugView.
  4. Return to your store in the Tag Assistant window and simulate a complete customer journey: view a product, add it to the cart, and complete a test purchase.

As you perform these actions, watch the DebugView timeline in GA4. You should see events likeview_item AndpurchasePopulate in real-time. Click on the purchaseEvent in the timeline to expand its details.

Troubleshooting Checks for Parameter Completeness

Inspect the event parameters carefully. Missing parameters can cause conversions to be tracked but not attributed to campaigns, leading to gaps in ROAS calculations and missing revenue in GA4.

Check the Event Name: Is it exactlypurchase ? If it saysPurchase(capitalized) or completed_order, GA4 will not recognize it as a monetization event.

Check the Transaction ID: Does thetransaction_idMatch the test order number from your storefront?

Check the Value and Currency: Are bothvalue AndcurrencyPresent?

If currencyIs missing, GA4 may discard the value entirely.

Inspect the Items Array: Open theitems Tab within the event details. Do you see the specific products you bought? Verify that thepriceAnd quantityFields are populated correctly.

If any of these elements are missing or misnamed, you must return to your GTM configuration or your platform's integration settings to correct the data mapping before relying on this data for marketing decisions.

Step 6: Compliance and Marketing Integration

Once your tracking is verified and accurate, you must address user privacy compliance and connect your data to your marketing platforms.

Maintenance and Compliance Checks

Modern privacy regulations require that tracking respects user consent preferences. Ensure you configure Consent Mode v2 within your setup. Consent Mode adapts the behavior of Analytics, Ads, and third-party tags based on the consent status granted by the user via your cookie banner.

If a user declines analytics cookies, Consent Mode ensures that GA4 does not read or write cookies, but it can still send anonymized, cookieless pings to model conversion data. Many native platform integrations and GTM templates now support Consent Mode out of the box, but you must verify it is active to remain compliant.

Link Google Ads for Conversion Attribution

To maximize the value of your e-commerce data, connect your GA4 property to your Google Ads account.

  1. In the GA4 Admin panel, under Product Links, select "Google Ads Links."
  2. Click "Link" and select your active Google Ads account.
  3. Enable Personalized Advertising and Auto-tagging.

Linking these accounts allows you to import your newly verified GA4purchase Events directly into Google Ads as conversion actions. This integration is what enables the Google Ads algorithm to optimize bidding strategies based on actual storefront revenue rather than just clicks. Linking the accounts allows you to build highly specific remarketing audiences in GA4—such as users who triggered theadd_to_cartEvent but did not trigger the purchaseEvent—and share those audiences smoothly with Google Ads to target cart abandoners.

Frequently Asked Questions

How does GA4 differ from Universal Analytics for e-commerce?

GA4 uses an event-based model where every interaction is an event, whereas Universal Analytics relied on session-based hits and 'goals'. GA4 also introduces item-scoped custom dimensions and more flexible funnel reporting, allowing you to track the exact sequence of actions a user takes before purchasing. It offers a flexible tracking model that goes beyond outdated session-based analytics.

Are e-commerce events tracked automatically in GA4?

Some events are tracked automatically if you use native integrations (like the official apps for Shopify or BigCommerce), but most detailed e-commerce actions likeadd_to_cart Or purchaseRequire specific implementation of the Google tag or GTM if you are using a custom-built website. You cannot assume all revenue data will flow automatically without verifying the integration method.

Do I need to use Google Tag Manager?

While tracking can technically be set up by hard-codinggtag.jsDirectly into your website files, Google Tag Manager is strongly recommended. GTM provides a centralized interface to manage your data layer, making it significantly easier to update tracking parameters, deploy third-party marketing pixels, and maintain your setup without requiring constant developer intervention.

With the DebugView confirming successful event firing and your marketing platforms linked, your technical setup is complete. Your next priority is monitoring the first 48 hours of live data in the GA4 Monetization reports. Check the "E-commerce purchases" report to ensure the item names, categories, and revenue totals align with your storefront's actual sales backend. Once you verify that the data is flowing accurately, you can confidently use this foundation to evaluate campaign performance, calculate precise ROAS, and build targeted remarketing audiences based on specific shopping behaviors.

References

  1. conversios.io — GA4 Conversion Tracking Setup (2025): Event-Based Guide
  2. simoahava.com — Google Analytics 4: Ecommerce Guide for Google Tag Manager
  3. experienceleague.adobe.com — Google Tag Manager for Adobe Commerce (Magento)
  4. support.bigcommerce.com — Setting Up Google Analytics 4
  5. help.shopify.com — Setting up Google Analytics 4 for Shopify
  6. developers.google.com — Analytics - Measure ecommerce
  7. seranking.com — GA4 Ecommerce Guide for 2025
  8. searchengineland.com — GA4 Ecommerce Tracking Setup: Everything You Need to Know
  9. customerlabs.com — Setting Up GA4 Ecommerce Tracking with Google Tag ...
  10. searchenginejournal.com — GA4 Ecommerce Tracking: A Complete Guide

How this article was produced

One topic in, one finished draft out. Every ProofWrite article passes through the same stages.

  1. 1

    Plan

    Picks the article format and the angle worth writing from the topic.

  2. 2

    Research

    Gathers live sources and evidence before a single sentence is drafted.

  3. 3

    Outline

    Structures sections around the questions readers and AI answers actually ask.

  4. 4

    Write

    Drafts from the research, citing sources at the claims they support.

  5. 5

    QA and repair

    Catches filler, repetition, and default AI tone, then fixes what it finds.

  6. 6

    Fact-check

    Reviews every claim against the evidence and finds sources for the ones that lack one.

Write one like this for your siteYour Pilot starts when you generate your first article. No credit card required.
Example: How to Set Up GA4 Conversion Tracking for an E-commerce Store | ProofWrite