Company website and lead tools
A bilingual Next.js site whose self-assessments score each visitor, create the lead in Zoho CRM, and route it to the right follow-up automatically.
- Role
- Sole developer
- When
- Feb – Oct 2026
The problem
ITFocus sells to small-business owners who often don't know yet what they need. A contact form doesn't help them, and it gives sales nothing to work with. We wanted visitors to get something useful on their own, and the team to get a qualified lead with context, without anyone retyping it into the CRM. Before this, the company had an old WordPress site with a contact form.
What I built
The UT-Ops site, in English and Spanish, with interactive assessments: Tech Check, an AI Rules policy generator, the Hours-Back Finder and a Fraud Readiness check. Each one scores the visitor's answers, shows them their result, and writes a scored lead into Zoho CRM, which starts the matching email sequence.
How it works
- The server re-scores everything. The browser sends only raw answers, so a tampered client can't fake a score. The score puts each visitor in a band, which sets both the result they see and how sales follows up.
- Five routing lanes run in priority order, so every lead lands in exactly one follow-up track: manual review, a priority call, an email sequence, a champion track or the newsletter.
- Zoho integration. OAuth refresh-token flow with the access token cached until five minutes before expiry. Leads are created with workflow triggers on, so Zoho starts the right sequence. The custom funnel fields sit behind a flag, because Zoho rejects the whole record if any field doesn't exist yet.
- Strict lookups. A failed Zoho search throws instead of returning "not found", so an outage can't create duplicate leads.
- Idempotent Stripe webhook. It acts only on paid sessions and records the session ID on the lead, so a retried webhook doesn't run twice.
- CI gates: lint at zero warnings, typecheck, unit tests, an i18n completeness check and
npm audit.
What broke and how I caught it
Funnel events from stage 3 onward, and the Zoho intent updates that went with them, were being lost. When an assessment moved to the next page, the browser navigated away before PostHog's batched events and the Zoho request had finished sending, so the requests were dropped. The late funnel was invisible in analytics, and some leads never got their intent data. I noticed when leads kept arriving in Zoho without the pay-or-call choice they had made in the assessment.
There were two causes. PostHog batches events and sends them every few seconds, and its send on page exit isn't reliable in every browser. And the browser cancels a normal fetch when the page unloads. Every event that fires right before a navigation now sends immediately instead of waiting for the batch, and the Zoho request uses fetch with keepalive, so the browser lets it finish after the page changes.
Result
- Live at utops.itfocus.solutions, in English and Spanish, with a sister site for Mexico that reuses the same Zoho client.
- 286 commits from February to October 2026, with about 134 tests.
Built with
Built with Next.js, TypeScript, Tailwind, next-intl, Vercel, Zoho CRM API, Resend, Stripe, PostHog