Case studies · Electrical retailer
Joining web analytics to SAP Commerce orders in BigQuery.
A national electrical retailer wanted one place to see orders, products and where its online customers came from. I rebuilt its tracking in GA4 and designed the Google Cloud pipeline to join GA4 with its SAP Commerce order data.
Client
National electrical retailer (name withheld)
Platform
SAP Commerce
What I did
GA4, BigQuery and Google Cloud
When
2023 to 2025
The challenge.
The retailer’s Universal Analytics set-up had no enhanced ecommerce and a thin dataLayer, and Universal Analytics was about to be switched off.
SAP Commerce, the ecommerce platform, records every order but not where the customer came from. Web analytics knows the source but not what happens to the order afterwards. The brief was one reporting database that joined the two, so the team could report on real orders by channel themselves.
What I did.
GA4 built around a thin dataLayer
A full GA4 ecommerce build in Google Tag Manager, using custom workarounds where the site’s dataLayer didn’t supply what GA4 needed.
GA4 joined to orders on transaction ID
A working prototype in BigQuery: GA4 purchase data, with source, medium and campaign for each transaction, joined to SAP Commerce order lines (status, product, price and quantity) once the order IDs were cleaned to match. The team could pull it straight into Excel.
A Google Cloud pipeline
A design for daily order exports landing in a Cloud Storage bucket, Python Cloud Functions to clean and reshape them, and a join with the GA4 export in BigQuery. Order files going back to January 2023 were loaded to start the history.
Specs developers can build from
A dataLayer guide for the site’s developers, now on its fourth version, plus server-side tracking documentation, to replace the workarounds with a proper dataLayer.
Where it landed.
The retailer moved off Universal Analytics onto a working GA4 ecommerce set-up, with a proven way to attach a marketing source to every SAP Commerce order, and a cloud pipeline and dataLayer spec its own developers could build on.
The lesson that stuck with me: the hard part of joining analytics to back-office data isn’t the SQL, it’s getting clean, regular exports out of the platform. If you’re planning something similar, sort the data feed first.
Tools used
GA4, Google Tag Manager, BigQuery, Google Cloud Storage, Cloud Functions (Python), SQL, SAP Commerce, Excel (BigQuery ODBC).
Want your analytics joined up?
Tell me what data you’ve got and what you can’t answer yet, and I’ll come back to you with how I’d connect it.