How I Made My Blog Remember You
Turning analytics and AI into a real-time, personalized homepage experience
Jun 19, 2025
A fellow CEO texted me a screenshot of my homepage. There it was—his name in the headline.
A nice surprise for someone who’d only dropped by once before.
That moment crystallized why I built analytics into the very foundation of my site—and how I turn that data into real-time personalization. Here's how it works.

The Core Idea
The homepage is your first impression. I wanted the messaging to be great—but every version of the copy I wrote felt too generic.
What if Person A sees it? What if Person B? What if Tim Cook stopped by—how would I capture his attention?
Then it clicked: a webpage isn’t just a brochure anymore. Websites are now apps. Apps can talk to large models. And if that’s true—why shouldn’t a webpage act like an agent?
So I built one. And I figured instead of just talking about what’s possible with AI, I’d show it—live, on my homepage.

Analytics as a First-Class Decision
Why start here? In most apps, analytics is an afterthought—bolted on once you realize you need to measure usage. I treated it as one of my first architectural decisions so that every request carries context about who is browsing.
- Durable visitor object: We piggyback on PostHog's anonymous visitor ID to identify the same person across sessions.
- Fast, non‑blocking: We cache profiles in Upstash Redis using a stale‑while‑revalidate pattern so visitors never wait.
- Respectful caching: profile data is stored securely and refreshed only after the page loads.
- Behind‑the‑scenes refresh: Next.js’s
after
hook kicks off cache updates if needed, after the page returns, ensuring zero impact on load times.
Respecting each visitor means remembering them like you would at a party and keeping their data safe.
How it works:
By treating analytics as core infrastructure, profile
is available everywhere—in page rendering, API routes, and even chat tools—without any special casing.
Recognizing & Enriching Returning Visitors
Now that we have a durable visitor profile available throughout the site, we can capture and enrich user-provided data before ever using it.
- Booking a meeting: when you type in your name and email and hit submit, we update your visitor profile from anonymous to identified—no extra steps or waits.
- Chat interactions: if you share your name or email with the bot, it updates the same profile—just like remembering someone’s name in person, we don’t throw it away.
We treat that info with respect—storing it securely so you never have to repeat yourself.
Once we collect an email, we enrich the profile via industry‑standard tools like Clearbit, fetching company name, logo, industry, employee count, and more:
Respecting user input means using it. For example:
- Form reuse: the next time you book a meeting, your first name and email are prefilled automatically.
- Chat reuse: the chat interface greets you by name and remembers your contact details.

This approach treats user-provided data with the respect it deserves—no needless retyping, no wasted opportunities.
Personalizing the Homepage: Data → Delight
With an enriched profile
, we can generate on-the-fly copy with an LLM. And with Next.js we can stream that in to the user while they're on the page. Respecting the visitor means addressing them as an individual, so this personalized text feels natural rather than creepy.


Personalizing copy
Here’s the full system prompt our agent sees:
We pass this string into the agent like so:
Example AI response for “Tim from Apple”:
Those strings slot right into React components:
If chat gathers new info mid-session, we silently re-run the agent, patch the DOM, and animate in fresh copy—no reload required.
Personalizing the chat bot
The chat assistant uses a similar setup. We feed it a rich system prompt so it knows how to behave:
When we call streamText
we pass this system prompt along with a set of tools:
This lets the bot enrich the visitor profile, look up references in Brennan's brain, and even schedule time if the chat goes well.
Choosing which model powers those prompts matters a lot. I ran the same setup across OpenAI, Anthropic, and Google, and shared the results in my breakdown of comparing models.
Parting Thoughts
Thinking of my homepage as an agent and making analytics core unlocked something powerful: a homepage that remembers, adapts, and responds in real time.
That can unlock a lot:
- What if you tailored pricing pages by persona?
- What if you sent follow-ups based on analytics journeys?
- What if you updated copy mid-session when new data appears?
I'm also keenly aware of how good AI can be at persuasion. In How AI Can Be Master Persuaders I explored how narrow fine-tunes can nudge models toward manipulative behavior. That shaped the guardrails around this experiment.
Pages don't need to be static brochures anymore. They can be thinking, adapting, and greeting you by name. That's true now not tomorrow.
But it's not just delight. It’s about respect. Pay attention. Remember people. Speak to them directly. Don't make them repeat themselves.
And when you do, you create a homepage that feels like it was made just for them.