A few months ago I set out to build a website for a medical practice — Dra. Lidia Pérez, a general-medicine doctor in Guadalupe, Costa Rica who specializes in the medical certificates (dictámenes) you need to get or renew a driver’s license. What started as a “just build a clean site” project turned into something more interesting: an end-to-end experiment in building and growing a site with an AI coding agent as my pair.
Here’s how it went, what worked, and the one moment the data made me eat my own conclusion.
Starting from a clean slate
The old site was a Hugo build that had drifted out of date. Rather than patch it, I rebuilt from scratch on a modern stack:
- →Next.js 14 (App Router) with a fully static export — no server to babysit, just HTML on a CDN.
- →TypeScript and Tailwind CSS for a typed, maintainable codebase.
- →Netlify for deploys.
The design goal was “editorial, not clinical” — a calm navy-and-gold palette, a serif display font, and articles that actually answer the questions people Google at 11pm before their license expires. Under the hood it’s a reusable component system fed by a typed content layer, so every article is just data that renders through the same pre-rendered route.
A few touches I’m happy with:
- →A scroll-aware navbar that starts transparent over the hero and fades into a solid bar as you scroll.
- →An accessible FAQ accordion.
- →A small rich-text renderer that parses inline links, so a “message us on WhatsApp” call-to-action can sit right in the middle of a paragraph.
Pairing with an AI agent
The whole thing was built with an AI agentic workflow — I worked alongside Claude Code the way you’d work with a fast, tireless junior engineer who’s read the docs. It scaffolded components, drafted article content, refactored when I changed my mind, and handled the tedious parts (structured data, metadata, image compression) while I reviewed every change.
The honest version of this story: AI didn’t replace the engineering judgment, it compressed the time between idea and working code. I still decided the architecture, read every diff, and rejected plenty. But the loop was dramatically tighter than typing it all myself.
SEO: the part everyone skips
For a business like this, the website is the marketing. So technical SEO wasn’t an afterthought:
- →Per-page metadata, canonical URLs, Open Graph and Twitter cards.
- →JSON-LD structured data — Physician / LocalBusiness, MedicalWebPage, FAQPage, and a MedicalProcedure schema for the dictamen itself, complete with price.
- →A real sitemap and robots config.
- →E-E-A-T signals for medical content: author credentials, publish/update dates, sources — the trust markers Google leans on for health topics.
Then I wired up GA4 with custom events for the two actions that actually matter: tapping the WhatsApp button and tapping the phone number.
Where it got fun: letting the AI read the analytics
Here’s the part I hadn’t done before. I connected Google Search Console, Google Analytics 4, and the Google Ads API to the AI agent through the Model Context Protocol (MCP) — basically giving the model live, queryable access to the marketing data.
Instead of clicking around dashboards, I could ask questions in plain language and get answers grounded in the real numbers. A few things fell out immediately:
- →The site was being found, but not clicked.Search Console showed ~15k impressions over 90 days, ranking positions 6–10 — but with a ~1% click-through rate when pages at those positions usually earn 4–8%. Showing up wasn’t the problem; winning the click was.
- →A huge cluster of “price” searches I was ranking for but capturing nothing on. Over a thousand monthly impressions for things like “cuánto cuesta el dictamen médico para licencia” — ranking positions 8–11 with basically zero clicks, because no result (mine included) showed a price. The fix: put “desde ₡20.000” right in the title and meta description. Nobody else does, so it stands out in the results.
- →A duplicate-URL problem quietly splitting my rankings. The same article was indexed at two URLs — and the old one ranked nearly twice as well (position 4.7 vs. 9.4) as the canonical one I was actually linking to. They were cannibalizing each other. A 301 redirect to consolidate them was probably the single biggest organic win available.
The moment I was wrong
Now the lesson I keep coming back to.
Looking at the Google Ads data, I confidently concluded that the “Smart” campaign was driving junk — tons of low-engagement display traffic, an 85% bounce rate, and “conversions” that looked like noise. My recommendation: cut it.
The client pushed back:
So I actually pulled the conversion breakdown instead of trusting my narrative. And I was wrong. The Smart campaign had generated 34 real phone-call leads in 30 days — people who tapped “call” right in the ad and never even loaded the website (which is exactly why they looked like “bad” traffic in GA4: they weren’t traffic at all, they were leads). Even better, the other campaign I’d assumed was working had generated 35 calls that were showing up as zero — because of a conversion-tracking mis-categorization. On a cost-per-call basis it was actually the cheaper of the two (~$0.62 vs. ~$1.81).
The real problem was never “bad campaign.” It was bad measurement. Fix the tracking, and the right decision becomes obvious.
The lesson isn’t subtle, but it’s worth saying plainly: an AI agent will produce a confident, plausible analysis from whatever data it’s looking at. The value isn’t in the first answer — it’s in being able to interrogate the data in seconds when a human asks “are you sure?” The combination of a skeptical client and instant queryable data caught a mistake that a tidy slide deck would have shipped.
What I’d take to the next project
- →Build with the agent, decide for yourself. The speed is real; the judgment still has to be yours.
- →SEO is product work, not garnish. Titles, structured data, and a single duplicate URL moved the needle more than any redesign would have.
- →Wire your data to where you ask questions. Putting Search Console and Ads behind a natural-language interface changed analytics from a chore into a conversation.
- →Verify before you recommend. Especially when the conclusion is convenient.
The site’s live, the price hooks are shipped, the redirects are in, and the conversion tracking is getting fixed. The next chapter is the boring-but-best part: watching the numbers actually move.