Section 01 of 09
Lead-gen system architecture
01Lead-gen system architecture
One pipeline for every channel. A lead from the website, a Meta instant form, TikTok, Snapchat or an Instagram comment lands in the same CRM within seconds, is assigned to a rep, and reports back to the ad platforms as a server-side event with the same event ID the browser pixel used.
Capture
Website forms post to a Cloudflare Worker (Turnstile, honeypot, rate limit, event ID), then to n8n. Meta instant forms arrive through the native GoHighLevel integration. Instagram comments reach n8n through the Meta webhook.
Normalise and route
n8n validates, maps attribution fields (platform, campaign, ad set, ad, form, first-touch UTMs), blocks duplicates, tags the project and consent source, opens an opportunity and round-robins the lead to an active rep with a WhatsApp alert.
Report back
Lead and browse events go server-side to Meta, TikTok, Snapchat and GA4 with a hashed visitor ID. Pipeline stage changes are polled every 10 minutes and sent as CRM conversion events, so the platforms optimise on qualified leads, not raw form fills.
Assist the team
Nurture suggestions, nudges, a conversation coach, a knowledge bot and an ops console sit on top. Nothing in the system messages a customer automatically; reps send, the system prepares.
Diagram Blue: acquisition. Amber: automation layer (Worker and n8n). Teal: sales and measurement. The dashed line is the feedback loop to the ad platforms.
Deduplication and the feedback loop
The browser pixel and the server send the same event with the same event_id, so the platform counts it once. The visitor ID cookie is hashed and sent as external_id, which lifts the match quality. Stage changes in the CRM become conversion events (Lead → Contacted → Interested → Qualified) so the campaigns learn from what sales actually qualifies.
Diagram Browser and server events carry the same ID; the platform keeps one. CRM stage changes feed the same conversion dataset.
Want this for your projects?
The whole stack, or one piece of it. WhatsApp is fastest.