Skip to main content

Google Analytics 4 Setup Guide for E-Commerce Sites

LaNexa Team

Google Analytics 4 (GA4) represents a fundamental shift in how web analytics works. Unlike its predecessor Universal Analytics, GA4 is built around an event-based model that tracks user interactions rather than page views. For e-commerce businesses, this means richer data, better cross-device tracking, and more powerful reporting — but only if you set it up correctly.

GA4 vs Universal Analytics: What Changed

The most important differences that affect e-commerce tracking include:

  • Event-based model — everything is an event in GA4, including page views. This gives you more flexibility in defining what matters to your business.
  • No more bounce rate (as you knew it) — GA4 uses "engagement rate" instead, which measures the percentage of sessions that lasted more than 10 seconds, had a conversion event, or had two or more page views.
  • Built-in machine learning — GA4 uses AI to fill in data gaps caused by cookie restrictions, ad blockers, and privacy regulations.
  • Cross-platform tracking — GA4 can track users across websites and mobile apps in a single property.

Setting Up E-Commerce Tracking

GA4 supports enhanced e-commerce tracking through a set of recommended events. The critical ones for any online store are:

  • view_item — fired when a user views a product detail page
  • add_to_cart — fired when a product is added to the shopping cart
  • begin_checkout — fired when the user starts the checkout process
  • add_payment_info — fired when payment details are submitted
  • purchase — fired when a transaction is completed successfully

Each event must include specific parameters like currency, value, and an items array containing product details (item_id, item_name, price, quantity, item_category). Here is the basic structure for a purchase event pushed to the data layer:

dataLayer.push({ event: "purchase", ecommerce: { transaction_id: "T12345", value: 89.99, currency: "EUR", items: [{ item_id: "SKU001", item_name: "Product Name", price: 89.99, quantity: 1 }] } });

Key Events and Conversion Tracking

In GA4, you mark specific events as "key events" (formerly called conversions). For e-commerce, the essential key events are:

  • purchase — the most important conversion event, tracking completed transactions
  • add_to_cart — a micro-conversion that indicates buying intent
  • sign_up — tracks new account registrations
  • generate_lead — tracks contact form submissions or newsletter sign-ups

To mark an event as a key event, navigate to Admin → Events, find the event, and toggle the "Mark as key event" switch. Key events appear in all standard reports and are used for Google Ads optimization.

Custom Dimensions and Metrics

GA4 allows you to create custom dimensions that provide additional context about your users and their behaviour. Useful custom dimensions for e-commerce include:

  • Customer type — new vs returning customer (pass this with each purchase event)
  • Payment method — track which payment methods are most popular
  • Shipping method — understand delivery preference patterns
  • Discount code used — measure the effectiveness of promotional campaigns

Register custom dimensions in Admin → Custom definitions, then include the corresponding parameters in your events.

Integrating with Google Ads

Linking GA4 with Google Ads unlocks powerful bidding strategies based on actual revenue data. Once linked:

  • Import GA4 key events as Google Ads conversions for smarter bidding
  • Create remarketing audiences based on user behaviour (viewed product but did not purchase, abandoned cart, high-value customers)
  • Use GA4's attribution reports to understand which campaigns and channels drive the most revenue

Navigate to Admin → Google Ads Links to establish the connection. Make sure the same Google account has access to both GA4 and your Google Ads account.

Common Pitfalls

  • Duplicate events — if you use both Google Tag Manager and a platform plugin (like WooCommerce Google Analytics), events may fire twice, inflating your data
  • Missing currency parameter — always include the currency parameter in monetary events, or revenue data will not appear in reports
  • Not filtering internal traffic — create a data filter to exclude your team's IP addresses from reports
  • Ignoring data thresholds — GA4 applies data thresholds when Google Signals is enabled, which can hide data in reports. Switch to device-based reporting identity if this is a problem.
  • Not testing in DebugView — always verify your implementation using GA4's real-time DebugView before going live

Conclusion

Properly configured GA4 gives you the insights needed to make data-driven decisions about your marketing spend, product strategy, and user experience. But a misconfigured setup can lead to bad data and worse decisions. LaNexa's analytics team can set up and audit your GA4 implementation to ensure every event, conversion, and integration is working correctly. Contact us for a free analytics consultation.

Tagged with: E-Commerce Analytics