How to Set Up Google Analytics 4 for E-commerce | OpsStack
Zoho CRM

How to Set Up Google Analytics 4 for E-commerce Tracking

How to Set Up Google Analytics 4 for E-commerce Tracking

Google Analytics 4 (GA4) replaced Universal Analytics in July 2023, and many e-commerce brands are still running misconfigured setups that produce unreliable data. In our experience, the most common problem isn’t that GA4 is complicated — it’s that the default installation misses critical e-commerce events that operators depend on for business decisions.

This guide walks through a correct GA4 e-commerce setup for Shopify stores, covering the events you need, how to verify they’re firing, and how to structure your reports to get actionable data.

Understanding GA4’s Event-Based Model

Universal Analytics was session-based — it tracked sessions, pageviews, and goals. GA4 is event-based — everything is an event. This means e-commerce tracking in GA4 works by firing specific events with specific parameters at each stage of the purchase funnel.

The key e-commerce events GA4 expects are:

  • view_item — product page viewed
  • add_to_cart — item added to cart
  • begin_checkout — checkout initiated
  • add_payment_info — payment details entered
  • purchase — order completed
  • view_cart — cart page viewed
  • remove_from_cart — item removed from cart

Each event should pass relevant parameters: item_id, item_name, price, quantity, currency, and transaction_id for the purchase event. Missing parameters means your reports will have data gaps.

Setting Up GA4 on Shopify

Option 1: Shopify Google & YouTube Sales Channel (Recommended for Most)

Shopify’s native Google & YouTube sales channel now supports GA4 and sends enhanced e-commerce events automatically. This is the recommended starting point for most Shopify stores — it handles standard e-commerce events without custom code.

Steps:

  • Install the Google & YouTube channel from the Shopify App Store
  • Connect your Google account and select your GA4 property
  • Enable “Enhanced conversions” in the channel settings
  • Verify events are firing using Google Tag Assistant or GA4 DebugView

Option 2: Google Tag Manager (Recommended for Full Control)

For stores that need granular control over what fires and when, or that run multiple tracking pixels and need a single container to manage them, Google Tag Manager (GTM) is the professional standard. GTM allows you to fire GA4 events alongside Meta Pixel, TikTok Pixel, and other tags from a single JavaScript container.

Setup overview:

  • Create a GTM account and container at tagmanager.google.com
  • Add the GTM snippet to your Shopify theme (theme.liquid)
  • Create a GA4 Configuration tag in GTM targeting all pages
  • Create GA4 Event tags for each e-commerce event, triggered by dataLayer pushes
  • Push e-commerce data to the dataLayer from your Shopify theme — this typically requires a developer or a Shopify app like Elevar that handles the dataLayer for you

Option 3: Elevar or a Dedicated Tracking App

Elevar is the most widely used third-party tracking solution for Shopify. It sets up a correct server-side dataLayer and fires GA4, Meta Pixel, TikTok Pixel, and other tags with verified data quality. For stores spending $10K+/month on paid acquisition, the data quality improvement typically justifies the cost ($200–$500/month).

Configuring GA4 for E-commerce Reporting

Enable Enhanced Measurement

In GA4 Admin > Data Streams > your Shopify stream, enable Enhanced Measurement. This automatically tracks page views, scrolls, outbound clicks, site search, video engagement, and file downloads without additional code.

Mark the Purchase Event as a Key Event

In GA4, go to Admin > Events and mark purchase as a Key Event (formerly “conversion”). This is what populates your conversion columns in reports and Google Ads.

Set Up Custom Dimensions

Register custom dimensions for any event parameters you want to use in reports. Go to Admin > Custom Definitions > Custom Dimensions and add: item_category, item_variant, and any product metadata that’s useful for your specific reporting needs.

Connect to Google Ads

Link your GA4 property to Google Ads in Admin > Google Ads Links. This enables GA4 conversion importing and audience creation from GA4 segments — critical for your paid acquisition campaigns.

Verifying Your E-commerce Setup

Never assume GA4 is working correctly — verify it:

  • GA4 DebugView: Admin > DebugView shows events in real-time as you browse your store with the GA4 Debugger Chrome extension enabled
  • Google Tag Assistant: Verifies tag firing on each page
  • Place a test order: Use a test payment method and verify the purchase event fires with correct revenue, transaction ID, and items
  • Check the E-commerce report: Reports > Monetization > Ecommerce purchases should show data within 24–48 hours

Common GA4 E-commerce Setup Mistakes

  • Duplicate purchase events: Firing the purchase event from both the Shopify native integration and a GTM tag — inflates revenue data. Pick one method and use it exclusively.
  • Missing currency parameter: GA4 requires a currency parameter on all purchase events. Missing it causes revenue to show as $0.
  • Not filtering internal traffic: Staff browsing inflates session and event counts. Create an internal traffic definition in Admin > Data Streams > Configure Tag Settings.
  • No cross-domain tracking: If your checkout is on a subdomain (e.g., checkout.yourdomain.com), configure cross-domain tracking so sessions aren’t broken at checkout.

Frequently Asked Questions

Does Shopify support GA4 natively?

Yes. Shopify’s Google & YouTube sales channel supports GA4 and sends enhanced e-commerce events automatically. This is sufficient for most stores. For full control and multi-platform tracking, Google Tag Manager with a proper dataLayer setup is preferred.

What e-commerce events should be tracked in GA4?

The core GA4 e-commerce events are: view_item, add_to_cart, view_cart, begin_checkout, add_payment_info, and purchase. Each should pass item-level parameters including item_id, item_name, price, quantity, and currency.

How do I verify my GA4 e-commerce setup is working?

Use GA4 DebugView (Admin > DebugView) with the GA4 Debugger Chrome extension to see events in real-time. Place a test order and verify the purchase event fires with correct revenue, transaction ID, and item data. Check Reports > Monetization > Ecommerce purchases after 24 hours.

What is Elevar and do I need it?

Elevar is a Shopify tracking app that sets up a server-side dataLayer and fires GA4, Meta Pixel, TikTok Pixel, and other tags with verified data quality. It’s recommended for stores spending $10K+/month on paid acquisition where tracking accuracy directly impacts ad performance.


Need help auditing your GA4 setup or building a tracking infrastructure you can trust? Contact OpsStack Consulting — we help e-commerce brands get their data foundations right.

Scroll to Top