Skip to main content
How-to

How to implement ga4 for an Ecommerce Store

By ยท Updated ยท 6 min read

What GA4 Implementation Means for Ecommerce

Implementing GA4 for an ecommerce store is not simply installing a tracking tag. It requires creating a GA4 property, configuring a data stream, deploying Google Tag Manager (GTM) or a native integration, enabling Enhanced Ecommerce events, and verifying that purchase data flows into GA4 without duplication or gaps.

The sequence matters. Skipping property configuration before tag deployment causes data to land in the wrong place. Skipping event validation before going live means weeks of corrupted data. The steps below are ordered to prevent those failures.

Step 1 โ€“ Create a GA4 Property and Data Stream

Log into Google Analytics and select Admin. Under Account, choose the correct account, then click Create Property. Name the property after the store (not the brand campaign), select the reporting time zone to match the store's operating region, and set currency to the store's transaction currency. Mismatched currency causes revenue figures to display incorrectly in reports.

Inside the new property, go to Data Streams and click Add Stream, then choose Web. Enter the store's exact domain including subdomain if applicable (e.g., www.example.com). Enable Enhanced Measurement โ€” this auto-tracks page views, scrolls, outbound clicks, site search, video engagement, and file downloads without additional GTM tags. Copy the Measurement ID (G-XXXXXXXXXX) before leaving this screen.

If the store runs on Shopify, BigCommerce, or WooCommerce, check whether the platform has a native GA4 integration before proceeding to GTM. Native integrations can deploy the base tag faster, but they often lack full ecommerce event support, so GTM remains the standard for complete data collection.

Step 2 โ€“ Deploy the GA4 Tag via Google Tag Manager

In GTM, create a new tag. Select Google Analytics: GA4 Configuration as the tag type. Paste the Measurement ID into the Measurement ID field. Set the trigger to All Pages. Publish the container. This fires the base GA4 tag on every page and begins collecting session, user, and page-view data immediately.

Do not rely on GTM's built-in variable for the Measurement ID if multiple GA4 properties exist across the account. Instead, create a Constant variable in GTM named GA4 Measurement ID and reference it in every GA4 tag. This prevents accidental cross-property data contamination when the tag library grows.

After publishing, open GA4 DebugView (Admin โ†’ DebugView) and browse the store in a Chrome tab that has the GTM Preview extension active. Confirm that page_view events appear in DebugView within two to three seconds. If they do not, the most common cause is GTM container code missing from the site's <head> and <body> sections.

Step 3 โ€“ Implement Ecommerce Events in the Correct Sequence

GA4 ecommerce tracking relies on a defined set of events pushed to the dataLayer. The standard purchase funnel events are: view_item_list, view_item, add_to_cart, begin_checkout, add_payment_info, and purchase. Each event carries an items array that describes the products involved. Implement them in funnel order โ€” pushing purchase before add_to_cart produces orphaned transactions with no upstream attribution.

For the purchase event, the required parameters are transaction_id, value, currency, and the items array. The transaction_id must be unique per order. Duplicate transaction IDs cause GA4 to deduplicate revenue and undercount actual sales. Pull the order ID directly from the platform's order confirmation page rather than generating a client-side ID.

On Shopify, the purchase event fires on the /thank_you page. Use a GTM trigger set to Page URL contains /thank_you and push order data via Shopify's Liquid template into the dataLayer before the GTM container fires. On WooCommerce, the woocommerce_thankyou hook provides the same capability. Test with a real or sandbox transaction before moving to validation.

Step 4 โ€“ Configure Conversions, Audiences, and Filters

In GA4, mark the purchase event as a conversion by going to Admin โ†’ Events, finding purchase in the event list, and toggling Mark as Conversion. GA4 does not automatically count purchase as a conversion โ€” this toggle is required for conversion data to appear in reports and Google Ads.

Set up an internal traffic filter to exclude employee and agency IP addresses. Go to Admin โ†’ Data Streams โ†’ Configure Tag Settings โ†’ Define Internal Traffic, then add IP ranges. Without this filter, QA sessions from developers inflate session counts and corrupt conversion rates.

Create at minimum two audiences: Purchasers (users who fired the purchase event in the last 30 days) and High-Intent Non-Purchasers (users who fired add_to_cart but not purchase in the last 7 days). These audiences publish to Google Ads automatically once the GA4 and Google Ads accounts are linked under Admin โ†’ Google Ads Linking.

Step 5 โ€“ Validate Data Accuracy Before Relying on Reports

Run a three-day parallel comparison between GA4 transaction counts and the store's order management system (Shopify admin, WooCommerce orders, etc.). Acceptable variance is under five percent. Variance above five percent indicates either missing purchase event fires (common on accelerated checkouts like Shop Pay) or duplicate fires (common when GTM tags fire on both the order confirmation page and a post-purchase upsell page).

Check the Realtime report and DebugView against a live test purchase. Confirm the transaction_id matches the platform's order number, the value matches the net revenue figure (not gross including tax unless the business measures that way), and the items array contains the correct SKUs and quantities.

Once variance is within range and DebugView confirms clean event structure, the implementation is production-ready. Document the GTM container version number, the date validation was completed, and the baseline transaction count used for comparison. This record becomes the reference point for any future audit.

Frequently asked questions

How long does a full GA4 ecommerce implementation take?

For a store on Shopify or WooCommerce with an existing GTM container, a complete implementation โ€” property creation, tag deployment, ecommerce event setup, and validation โ€” takes three to five business days. The bulk of that time is writing and testing the dataLayer pushes for each funnel event, not the GA4 configuration itself.

Do I need Google Tag Manager to implement GA4 for ecommerce, or can I use a native integration?

Native integrations on Shopify and WooCommerce deploy the base GA4 tag quickly but rarely support the full ecommerce event schema (add_to_cart, begin_checkout, add_payment_info). GTM gives full control over the items array and event parameters. For stores that need accurate purchase attribution and funnel reports, GTM is the standard approach.

Why is my GA4 transaction count lower than my actual orders?

The most common causes are: the purchase event not firing on accelerated checkout flows (Shop Pay, PayPal express), the GTM container loading after the dataLayer push on the confirmation page, or the /thank_you trigger being too broad and missing mobile sessions. Use DebugView and a sandbox transaction to isolate which step in the firing sequence fails.

Should the GA4 revenue value include tax and shipping or just product revenue?

GA4 does not enforce a standard. The value parameter should match whatever metric the business defines as revenue. Most ecommerce operators exclude tax and shipping to align GA4 revenue with net product revenue used in their P&L. The key rule: apply the same logic consistently so reports stay comparable over time.

Can GA4 run in parallel with Universal Analytics if UA was already collecting ecommerce data?

Universal Analytics stopped processing new hits in July 2024, so parallel running is no longer applicable for new data. For historical comparisons, export UA data to BigQuery or CSV before it becomes inaccessible. GA4 is now the only Google Analytics option for live data collection.

MG
Written by

Matt is the founder of RunOctopus. He built All Angles Creatures from zero to page-1 rankings in reptile feeder insects in under 60 days using exactly this method โ€” turning a hard, entrenched niche into RunOctopus's proof store for programmatic SEO and AI search citation.

Connect on LinkedIn →

See what Otto would build for your store

Free architecture preview. No card required. Five minutes.

Generate Preview →