GOOGLE ANALYTICS (GA4) + Server-Side GTM on GCP + Cloudflare | Tripled Analytics Coverage

The Human Story
“For 20 years, Mid City Engineering sold automotive electronics without seeing what customers did on its website: what they searched, what they compared, where they gave up. I turned the lights on.”

The Stakes
You can’t grow what you can’t see. Two things stood in the way:

  • WordPress & Odoo aren’t good at analytics. Mid City’s original WordPress website had plugins that tremendously slowed the website; when we switched to Odoo, we saw that carts, checkouts, and purchases happened silently, with no events for analytics to hear.
  • The internet hides the best buyers. Ad blockers and Safari’s privacy protections quietly drop tracking requests, and they hit hardest on the technical, high-intent buyers Mid City cares about most.

The Build
Three layers, each shipped and verified before the next:

  • Teaching Odoo to talk: a custom script that turns cart adds, removals, shipping choices and purchases into analytics events. Purchases fire exactly once per order, even across bank redirects and page refreshes.
  • Moving measurement in-house: every analytics request now goes through Mid City’s own domain. A Cloudflare Worker relays it to a server-side GTM container on Google Cloud Run, which fans it out to GA4 and Google Ads. The standard fix needed Cloudflare’s Enterprise plan; 20 lines of Worker code did the same job. ~7.1K requests/day, 0 errors.
  • Keeping the data clean: an edge layer of CSP, HSTS and bot management blocks ~9.3K bot requests a day (21% of all traffic) before they can pollute the numbers, while search crawlers pass freely.

Ready for Ads
Measurement came first, then spend. Form submissions and phone taps became Google Ads conversions, weighted 2:1 so bidding knows what a lead is worth. Enhanced conversions carry hashed customer data that never leaves Mid City’s own infrastructure unhashed.

The Impact

  • Business: +200% GA4 events; every step from cart to purchase now visible; conversion tracking in place before the first ad dollar was spent
  • Human: delivered with an intern in 3 weeks through a 9-step plan with a working MVP at every step, teaching DNS, proxies, servers and cookies along the way
  • Technical: Safari cookie lifespan from 7 days to 2 years; 0 Worker errors; customer data hashed server-side

What’s Next
Mid City has launched the first paid ad campaigns in its 20+ year history, and for the first time, every click has somewhere to report back to. I maintain the tracking stack on retainer as the campaigns grow.

Tech Stack: GA4, Google Tag Manager (web + server), Google Cloud Run, Cloudflare (Workers, Tag Gateway, CSP, HSTS, Bot Management), Google Ads (Enhanced Conversions), JavaScript

You can’t grow what you can’t see. Now they can.