When we decided to add analytics to our car rental platform, the goal was straightforward: understand how much traffic we're getting and whether our booking funnel actually works. The execution? Less straightforward.
The Starting Point: Choosing the Right Tool
Before writing a single line of code, we sat down and evaluated our options. The conversation went back and forth — self-hosted analytics (Plausible, Umami) versus Google Analytics 4. Self-hosted gives you privacy and simplicity. GA4 gives you the ecosystem, the integrations, and — honestly — the complexity.
We chose GA4. For a small rental business, the ability to eventually run ads and measure their impact directly in the same platform tipped the scale. But we knew what we were signing up for.
The Cookie Consent Challenge
Here's something most tutorials skip: if you're operating in a jurisdiction with cookie regulations (GDPR, anyone?), you can't just slap a tracking tag on your site and call it a day. You need a consent banner. Not a fake one — a real one that:
- Shows before any tracking fires
- Stores the user's choice
- Actually blocks GA4 from loading if the user declines
- Remembers the decision in
localStorageso returning users don't get spammed
We built the consent banner as part of the same integration. It's the unglamorous half of the project, but without it, you're not compliant. And for a business that depends on trust, that matters.
The Implementation: AI-Designed, AI-Built, Human-Debugged
Every line of tracking code in this integration was designed and implemented by an AI agent. But — and this is important — it didn't start from a blank slate. The agent worked from a joint analysis where we laid out the requirements, weighed different approaches, and made the architectural call to go with GA4.
The implementation followed a structured pipeline: requirements → analysis → design → implementation → testing. Each phase produced documents that the next one consumed. The agent wrote the tracking tag, the funnel events, the consent banner, the contact page tracking, and the abandonment detection.
It wasn't perfect on the first try. Or the second. The implementation iterated a few times — events weren't firing in the right order, the consent logic had edge cases, and the funnel tracking needed adjustment to match how users actually move through the site.
Why the Final Touch Had to Be Human
This is the part nobody warns you about. GA4's configuration is... particular. It's not that it's hard to understand conceptually — it's that the devil lives in details so specific and so niche that no AI agent (yet) can navigate them reliably on its own.
The Measurement ID setup, the data stream configuration, the debug view, the real-time reporting delay, the difference between events and conversions, the key events vs. regular events distinction — each one is a small configuration trap. Individually, none of them are rocket science. Together, they form a maze that requires human intuition and patience.
The AI built 90% of the implementation. The last 10% — making sure GA4's dashboard actually reflected what was happening on the site — required a human sitting in the GA4 admin panel, clicking through obscure settings, and verifying that real-time data was flowing.
What We're Tracking Now
After all the iterations and the human polish, here's what we have:
- Page views across the entire site
- Funnel events — from landing page to vehicle selection to booking
- Contact tracking — when users start the contact flow and when they complete it
- Lead generation — confirmed inquiries as
generate_leadevents - Abandonment — basic
checkout_abandonmentdetection usingbeforeunload
All of this is consent-gated. No data flows unless the user opted in.
What This Enables
The tracking isn't the end goal — it's the foundation. Now we can answer two questions that were pure guesswork before:
- How much traffic are we actually getting? Not "I think someone visited" — actual numbers, sources, and trends.
- Does our conversion funnel work? Where do people drop off? Which step loses the most users?
These aren't academic questions. For a small car rental business, knowing whether your pricing page or your vehicle selection page is the leaky bucket is the difference between spending money on the right fix and burning budget on the wrong one.
The Bigger Picture
This project reinforced something we keep learning: AI agents are incredibly good at the 90% — the code, the structure, the logic. But the last 10% often lives in the gap between what the documentation says and what the tool actually does. That's where humans still earn their keep.
The code was AI-generated. The architecture was a joint decision. The final mile was human. That's the workflow that works.