GA4 and GTM Ecommerce Tracking: Stop Wasting Your Advertising Budget
Imagine spending €1,000 on Google Ads and receiving orders, but your analytics reports show neither sales revenue nor which keyword generated a profitable sale. Setting up ecommerce tracking in Google Analytics 4 is about much more than attractive charts. It helps you distinguish profitable campaigns from loss-making ones.
Marketing Terms
- GA4 (Google Analytics 4) — Google’s newer analytics platform, which replaced Universal Analytics.
- GTM (Google Tag Manager) — a tag manager that lets you manage website tracking without asking a developer for every change.
- Data Layer — a website data structure that passes product, price and transaction information to GTM.
- ROAS (Return on Ad Spend) — return on ad spend: the revenue earned for every euro invested in ads.
1. Why Ecommerce Analytics Matters: Common Mistakes
Many online stores track little more than page views. A marketer may see that a shopper reached the order confirmation page but not know whether they bought a €10 phone case or a €1,500 television.
Proper ecommerce tracking through GTM solves this problem:
- GA4 receives the precise order amount, excluding VAT and delivery costs.
- You can see which products shoppers added to and removed from their carts.
- Google Ads uses purchase data to train Smart Bidding strategies, aiming to attract valuable customers rather than just more website visits.
2. A Baltic Ecommerce Problem: Bank Payments Distort Traffic Sources
In Estonia, Latvia and Lithuania, many shoppers pay by bank link through Swedbank, SEB or LHV, or use payment providers such as Montonio and Maksekeskus.
How attribution can go wrong:
- A shopper clicks your Google ad (traffic source: Google Ads).
- They add a product to the cart and choose “Pay with Swedbank”.
- The store redirects them to `swedbank.ee` to confirm the payment.
- After a successful payment, the bank returns the shopper to the store.
- The analytics error: GA4 may no longer attribute the purchase to Google Ads and can record the new session as `swedbank.ee / referral`.
At month-end, it may look as though Swedbank generated 90% of your revenue while Google Ads contributed nothing. We address this by configuring the Referral Exclusion List (unwanted referral sources), helping preserve the original attribution through checkout.
3. Google Consent Mode v2: Essential for Europe
In March 2024 Google tightened its rules for data collection in the European Economic Area (EEA). If your website does not have Consent Mode v2, it can limit remarketing audiences in Google Ads and affect the learning of automated campaigns such as Performance Max.
How Consent Mode v2 Works:
- The website displays a cookie consent banner.
- If a visitor declines, GTM restricts marketing tags; depending on the configuration, Google may still receive limited signals (pings) without personal data.
- Google can use machine learning to model conversions for visitors who declined consent and recover some data missing from reports.
4. Enhanced Conversions
Ad blockers and browser privacy settings such as Safari ITP make traditional cookies less reliable. Some transactions may not be reported to Google Ads.
To give advertising algorithms more accurate purchase signals, we implement Enhanced Conversions. This feature uses an email address or phone number entered at checkout, hashes it in the browser with SHA-256 and sends the hash to Google. Google may match it to users who interacted with your ads, improving conversion measurement when cookies are restricted.
5. Server-Side Tagging
The next step in analytics is moving some tracking logic from the visitor’s browser to your own cloud server. Server-side GTM gives you more control over the data being sent, can reduce the number of marketing scripts loaded in the browser and makes tracking easier to manage. Privacy and consent requirements still apply.
Professional Analytics to Improve Profitability
Quality data helps advertising algorithms perform better. We set up transparent tracking so you can assess the return on every euro spent on advertising.
- Setting up the Data Layer and ecommerce tracking in GTM.
- Cleaning up bank-payment referrals (Referral Exclusion).
- Configuring Consent Mode v2 for EU consent requirements.
- Setting up server-side tagging for better measurement.
Official Documentation and Resources:
- GA4 E-commerce Developer Guide — Google’s official requirements for the ecommerce Data Layer.
- About Enhanced Conversions — Google’s help pages for setting up enhanced conversion tracking.
- Google Consent Mode v2 — technical guidance for implementing consent mode in the EU.