Guides / E-commerce setup

Setting up Google Analytics 4 for UK e-commerce stores

A practical guide to implementing Google Analytics 4 on UK e-commerce stores. Covers enhanced events, conversion tracking, consent mode and local reporting…

Setting up Google Analytics 4 for a UK e-commerce store requires configuring enhanced events, conversion tracking, consent mode and reporting views that respect local data needs. The process differs between Shopify, WooCommerce and Magento but follows the same core principles of accurate measurement while meeting privacy expectations.

This guide walks through the practical steps to implement GA4 correctly, from initial property creation to testing events and ensuring compliance with UK requirements. Each stage includes specific actions and the reasoning behind them so you can adapt the setup to your platform and business model.

Creating your GA4 property and data stream

Begin by signing into a Google account linked to your business and navigating to analytics.google.com. Select the option to create a new property, choosing Google Analytics 4 as the type. Enter your store name, select the United Kingdom as the reporting location, choose the appropriate industry category and time zone (GMT or BST). This ensures reports reflect UK business hours and currency defaults to GBP.

After property creation, add a web data stream. Input your exact homepage URL and enable enhanced measurement. The reasoning here is that enhanced measurement automatically tracks page views, scrolls, outbound clicks and file downloads without extra code, providing a solid baseline before adding e-commerce events. Copy the measurement ID (G-XXXXXXXXXX) as it will be needed for installation on your store.

Installing the GA4 tracking code on your platform

For Shopify, go to Online Store > Preferences and paste the GA4 code into the Additional Google Analytics javascript box, or use a dedicated GA4 app from the Shopify App Store that supports server-side tracking. WooCommerce users should install the official Google Site Kit plugin or a dedicated GA4 plugin that allows direct insertion of the measurement ID. Magento requires adding the code via the Google Analytics integration in Stores > Configuration or by editing the theme's head section.

The goal is to fire the config command on every page with your measurement ID. Use Google Tag Assistant or the browser preview mode to confirm the tag fires without errors. Server-side tagging via Google Tag Manager is preferable for e-commerce because it reduces reliance on browser cookies and improves data accuracy when customers use ad blockers.

Configuring enhanced e-commerce events

GA4 uses an event-based model rather than the session-based approach of Universal Analytics. Enable enhanced e-commerce by pushing specific events: view_item for product pages, add_to_cart, begin_checkout, add_shipping_info, add_payment_info and purchase. Each event must include relevant parameters such as item_id, item_name, price, quantity, currency and value.

On Shopify, the checkout.liquid or a checkout extension can push these events. For WooCommerce, use a plugin that maps standard WooCommerce actions to GA4 events or add custom JavaScript to the thank-you page for the purchase event. The reasoning is that these named events allow GA4 to calculate metrics such as cart-to-view rate and average order value automatically. Test each event in real time using the DebugView report to ensure parameters are populated correctly before going live.

Setting up conversion tracking and key events

Mark your most important actions as conversions inside GA4. The purchase event should always be a conversion. Additional conversions might include generate_lead for newsletter sign-ups or submit_application for trade accounts. Set a monetary value where appropriate so that return on ad spend calculations become possible.

Create audiences based on these conversions, such as purchasers or cart abandoners, to enable remarketing lists. In the Admin section under Events, mark the relevant events as conversions. The practical benefit is that advertising platforms such as Google Ads can then optimise campaigns toward these events. Avoid marking every micro-interaction as a conversion; focus on actions that contribute directly to revenue so reports remain actionable rather than cluttered.

Implementing Google Consent Mode v2

UK stores must respect visitor consent for cookies and data storage. Implement Consent Mode v2 by adding the gtag consent commands before the GA4 config line. Default both analytics_storage and ad_storage to 'denied' until consent is granted. Use a consent management platform compatible with your e-commerce system that triggers the update command when the visitor accepts or rejects cookies.

Consent Mode allows limited cookieless modelling for advertising and analytics when consent is denied. This helps maintain some measurement capability while remaining compliant. Test the consent states in DebugView by simulating accepted and denied scenarios. Update your privacy policy to explain how data is used and provide a clear way for users to withdraw consent at any time.

Configuring reports for UK requirements and data visibility

Within the GA4 property, create custom reports or explorations that show UK-specific dimensions such as country, region and city. Filter out internal traffic by defining your office IP addresses in the Data Settings > Data Filters section. This prevents your own team visits from skewing conversion rates and average order values.

Set up cross-domain tracking if you operate multiple domains or subdomains. Enable enhanced measurement for file downloads if you provide catalogues or guides. For local reporting needs, schedule regular exports of raw event data or connect GA4 to BigQuery if your volume justifies the cost. Review the Monetisation and Acquisition reports weekly to identify which channels deliver the highest value orders rather than just sessions.

Testing, maintenance and common pitfalls

Use the GA4 DebugView and Google Tag Assistant Preview to validate every new event before release. Check the Realtime report after making changes to confirm data arrives. Common issues include missing currency parameters causing value to be ignored, duplicate purchase events on thank-you pages, and consent mode not updating correctly after a visitor changes preferences.

Schedule a monthly review of your implementation. Platforms update their templates and GA4 occasionally changes recommended parameters. Document your event taxonomy so new team members understand the naming convention. If you run paid advertising, verify that your conversion tracking aligns with the platforms you use so attribution data remains reliable.

Frequently asked questions

Do I need Google Tag Manager for GA4 on my e-commerce store?

Google Tag Manager is not strictly required but is strongly recommended for UK e-commerce stores. It centralises all tracking tags, makes consent mode implementation easier, and supports server-side tagging which improves data quality when visitors block third-party cookies. Most Shopify and WooCommerce setups work with direct GA4 code but gain flexibility with GTM.

How does consent mode affect my GA4 data in the UK?

Consent mode v2 allows GA4 to collect limited cookieless data for modelling when users decline cookies. This helps reduce gaps in reports while remaining compliant with UK privacy expectations. Without consent mode, rejected consent results in no data collection at all. Always default to denied until explicit consent is given.

What are the most important GA4 events for an e-commerce store?

The core events are view_item, add_to_cart, begin_checkout, add_shipping_info, add_payment_info and purchase. These allow GA4 to calculate funnel drop-off rates and revenue automatically. Mark the purchase event as a conversion. Additional events such as login or newsletter signup can be added if they support your marketing goals.

Should I filter out my own visits from GA4 reports?

Yes. Internal traffic from your team or contractors can distort conversion rates and average order values. Define internal IP addresses in GA4 data filters to exclude them. This produces cleaner reports that accurately reflect customer behaviour and advertising performance.

Can I use the same GA4 property for multiple stores?

You can use one property with multiple data streams if the stores are closely related. For separate brands or very different product ranges, create separate properties. Separate properties make it easier to apply different consent configurations and reporting views tailored to each audience.

Related reading: Implementing authentic customer reviews on UK e-commerce sites, Managing inventory across Shopify, Amazon and your UK website, Preparing your e-commerce store for Black Friday in the UK. Browse all e-commerce setup guides or apply to Loomworks.

Cohort one / 2026

Turn the reading into real progress.

Build alongside other founders inside a working, AI-first e-commerce group in Liversedge.

Start your application →
Free desks · no fees · no equityApply now