Skip to main content
Completions

Architecture swarm · Lead Scoring + Routing Agent · Multi-source lead-ingestion skill · Published July 10, 2026

How to build multi-source attribution-preserving lead ingestion

A lead that arrives without its source is revenue you will never be able to explain, and most ingestion pipelines strip the source first. This guide builds lead ingestion that preserves attribution from every channel to the CRM record; the substrate below is what it carries through.

Apple App Tracking Transparency landed in iOS 14.5 on April 26, 2021 and Google pivoted Chrome third-party cookie deprecation to a Privacy Sandbox user-choice model in July 2024. Lead-source attribution collapsed for stacks that depended on third-party cookies. The canonical response — server-side tagging via Google Tag Manager server container + per-platform Conversions API (Meta + Google + Microsoft + TikTok + LinkedIn + Pinterest + Snapchat + Reddit) + CHIPS partitioned-state cookies + FedCM + first-party-cookie persistence — preserves attribution but only when click-ID preservation, consent-state propagation, cross-source deduplication, and cross-source master-record merge are coordinated end-to-end. The Capture + Resolve + Gate + Audit skill bundle on the Lead Scoring + Routing Agent sits above the 40+ lead-source surface and the 9+ CRM-destination surface and writes a per-lead canonical record with named regulatory anchors preserved in every audit record: Apple ATT + Google Privacy Sandbox + FTC v X-Mode + Mobilewalla + Copley Advertising 2017 + CCPA + GDPR Article 22 + TCPA + FCC 24-18 + 10DLC + CASL + FCRA + ECOA + FDD Item 12 + EU AI Act.

The 4-skill bundle on the Lead Scoring + Routing Agent

Capture

40+ source adapters (paid-social Meta + Google + TikTok + LinkedIn + Pinterest + Snapchat + Reddit; form-capture Typeform + Jotform + Gravity Forms + WPForms + Formstack + HubSpot Forms + Salesforce Web-to-Lead + Marketo + Unbounce + Instapage + Leadpages + ConvertKit; phone + SMS + chat handoff CallRail + CallTrackingMetrics + Marchex + Invoca + Twilio + Bandwidth + Plivo + Telnyx + Vonage + Intercom + Drift + Olark; integration Zapier + Make + Workato + Tray.io + n8n). 10-parameter click-ID preservation (UTM + gclid + fbclid + msclkid + ttclid + li_fat_id + twclid + epik + Snap + Reddit + custom). Server-side tagging via Google Tag Manager server container + Meta Conversions API + Google Enhanced Conversions + Microsoft UET Enhanced Conversions + TikTok Events API + LinkedIn / Pinterest / Snapchat / Reddit Conversions API. CHIPS partitioned-state cookies + Topics API + Protected Audience API + Attribution Reporting API + FedCM. Per-source rate-limit + pagination + retry.

Resolve

Per-lead deduplication (deterministic email / phone E.164 / customer ID / loyalty ID before probabilistic Jaro-Winkler / Levenshtein / Damerau-Levenshtein / Soundex / Metaphone / fuzzy email / IP / device fingerprint) with per-60-second / 1-hour / 24-hour / 30-day window. Cross-source master-record merge (survivorship + attribution merge preserving first-touch + last-touch + multi-touch fingerprint + consent merge + LTV aggregation). Per-location routing (DID + ZIP + IP + state + radius + DMA + CBSA + FDD Item 12 territorial-rights attestation + territory-overlap resolution + fallback to corporate). LLM-augmented tie-breakers under per-vendor zero-retention flag conflicts for operator review.

Gate

Five anchors before commit. Apple ATT iOS 14.5 + App Store Review Guideline 5.1.2 + Google Chrome third-party cookie deprecation + Google Privacy Sandbox + Safari ITP + Firefox ETP + per-platform Conversions API server-side tagging discipline + FTC v X-Mode Outlogic + FTC v Mobilewalla + FTC v Kochava + Massachusetts AG v Copley Advertising 2017. CCPA + CPRA + 17-state + WA My Health My Data + Texas SCOPE + GDPR Article 6 + 7 + 17 + 22 + LGPD + DPDP + PIPEDA + Quebec Law 25 + COPPA; consent-management platforms (OneTrust + Cookiebot + Usercentrics + Didomi + Sourcepoint + Quantcast Choice) propagate STOP / right-to-erasure cross-source. TCPA + FCC 24-18 + 14-state two-party-consent + state mini-TCPAs + 10DLC + CTIA + CASL 36-month + Federal DNC + state DNC + TSR + CAN-SPAM. FCRA + ECOA + Fair Housing + GLBA + HIPAA + FINRA Rule 2210 + 3110 + SEC Reg S-K + FDA 21 CFR Part 11. FDD Item 12 + 15-state franchise + FDD Item 17 + 19 + CFPB UDAAP + FTC Section 5 + Pfizer 1972 + Endorsement Guides + EU AI Act Article 22 + 26 + 50 + Digital Services Act + NIST AI RMF + ISO 42001 + per-vendor LLM zero-retention. Policy-as-code via OPA Rego + AWS Cedar + Casbin + Cerbos + Oso + Styra DAS + Permit.io.

Audit

Per-lead WORM record. CRM emission across 9+ standing CRM destinations (Salesforce + HubSpot + Microsoft Dynamics 365 + Zoho + Pipedrive + Keap + ActiveCampaign + Copper + SugarCRM + Freshsales + Insightly + Nutshell + Apptivo + monday CRM + Method) with exactly-once semantics + per-CRM emission status + per-CRM emission failure DLQ. DSAR export on demand. Storage: AWS S3 Object Lock + Azure Blob immutable + Google Cloud Storage Bucket Lock + Wasabi WORM. Retention stacks (longest applicable wins): 7-year FTC + 7-year IRS + 7-year FDD + per-state franchise + 7-year HIPAA + 6-year SEC + 3-year FINRA 4511 + 3-year FINRA Rule 3110 + per-state two-party recording + 36-month CASL + GDPR Article 30 + CCPA 12-month + EU AI Act Article 12 + SOC 2 CC7 / CC8. End-to-end replay rewinds every stage.

The real vendor ecosystem this sits above

Lead sources + CRM destinations

Paid-social lead-capture (Meta Lead Ads + Google Lead Form Extensions + TikTok Lead Generation + LinkedIn Lead Gen Forms + Pinterest Lead Ads + Snapchat Lead Gen + Reddit Lead Generation). Form-capture (Typeform + Jotform + Gravity Forms + WPForms + Formstack + HubSpot Forms + Salesforce Web-to-Lead + Marketo + Unbounce + Instapage + Leadpages + ConvertKit). Phone + SMS + chat handoff (CallRail + Marchex + Invoca + Twilio + Bandwidth + Plivo + Telnyx + Vonage + Intercom + Drift + Olark). Integration (Zapier + Make + Workato + Tray.io + n8n). CRM destinations (Salesforce + HubSpot + Microsoft Dynamics 365 + Zoho + Pipedrive + Keap + ActiveCampaign + Copper + SugarCRM + Freshsales + Insightly + Nutshell + Apptivo + monday CRM + Method).

Server-side tagging + consent + event bus

Google Tag Manager server container + Meta Conversions API + Google Enhanced Conversions + Microsoft UET Enhanced Conversions + TikTok Events API + LinkedIn Conversions API + Pinterest Conversions API + Snapchat Conversions API + Reddit Conversion API. Google Privacy Sandbox APIs (Topics + Protected Audience FLEDGE + Attribution Reporting + FedCM + CHIPS). Consent platforms (OneTrust + Cookiebot + Usercentrics + Didomi + Sourcepoint + Quantcast Choice). Event bus (Kafka + AWS Kinesis + Google Pub/Sub + Azure Event Hubs + Redpanda + Confluent).

Policy-as-code + WORM + sibling skills

OPA Rego + AWS Cedar + Casbin + Cerbos + Oso + Styra DAS + Permit.io policy-as-code expresses every Gate rule. AWS S3 Object Lock + Azure Blob immutable + Google Cloud Storage Bucket Lock + Wasabi compliance WORM holds the per-lead audit substrate. OpenAI + Anthropic LLM tie-breakers under per-vendor zero-retention back Resolve conflict adjudication. Sibling skills: lead-capture-form (parent commercial); firmographic-enrichment-lead-routing (sibling build-pillar downstream enrichment consumer); buyer-state-aware BANT scoring (sibling build-pillar downstream scoring consumer); customer-data-graph agent (per-location per-channel per-brand CLV sibling); rollup-reporting agent (per-location MMM-driven budget recommendation + per-location cross-channel attribution rollup siblings); Lost-Call Recovery Agent when phone or SMS handoff is involved.

The 6-workstream reporting cycle

Numeric uplift commitments are not made up-front. The engagement ships a pre-engagement baseline across six workstreams; the cycle tracks delta against that baseline. Reporting is the substrate, not the promise.

  1. Capture coverage. Per-source adapter coverage across the 40+ lead sources; 10-parameter click-ID preservation completeness; per-platform Conversions API server-side tagging coverage; CHIPS + Privacy Sandbox API adoption posture; per-source rate-limit + retry telemetry.
  2. Resolve quality. Per-lead deduplication precision + recall; cross-source master-record merge consistency; per-location routing accuracy under FDD Item 12; LLM tie-breaker escalation rate.
  3. Gate quality. Per-anchor evaluation completeness (Apple ATT + Google Privacy Sandbox + Conversions API + FTC v X-Mode / Mobilewalla / Kochava + Copley + CCPA / CPRA / 17-state + GDPR Article 22 + TCPA + FCC 24-18 + 10DLC + CASL + FCRA + ECOA + HIPAA + FINRA + FDD Item 12 + EU AI Act); per-anchor pass / fail / route-to-counsel distribution; per-DSAR fulfillment turnaround.
  4. Audit quality. Per-lead WORM record completeness; retention-window coverage (longest of 7-year FTC + 7-year IRS + 7-year FDD + per-state franchise + 7-year HIPAA + 6-year SEC + 3-year FINRA 4511 + 3-year FINRA Rule 3110 + per-state recording + 36-month CASL + GDPR Article 30 + CCPA 12-month + EU AI Act Article 12 + SOC 2 CC7 / CC8); end-to-end replay success rate.
  5. Compliance posture. Apple ATT enforcement posture; per-platform Conversions API consent propagation completeness; CCPA opt-out + GDPR Article 22 transparency stamp coverage; ECOA disparate-impact audit cadence; FDD Item 12 territorial-protection adherence; EU AI Act Article 50 disclosure when AI-ML routing or spam detection participated.
  6. Audit-trail completeness. Per-anchor regulatory citation completeness; sibling-handoff pointer completeness into the lead-scoring-routing bundle (lead-capture-form parent + firmographic-enrichment-lead-routing + buyer-state-aware BANT scoring) and into downstream consumers (customer-data-graph agent CLV sibling; rollup-reporting agent MMM-driven budget recommendation + per-location cross-channel attribution rollup; Lost-Call Recovery Agent when phone / SMS handoff).

Frequently asked questions

What is multi-source attribution-preserving lead ingestion — and what changed after Apple ATT iOS 14.5 and Google Privacy Sandbox?

Apple App Tracking Transparency landed in iOS 14.5 on April 26, 2021 requiring explicit user opt-in to IDFA access. Google announced repeated extensions of Chrome third-party cookie deprecation and in July 2024 pivoted to a Privacy Sandbox user-choice model. Safari Intelligent Tracking Prevention and Firefox Enhanced Tracking Protection had already removed third-party-cookie carryover. Direct-to-consumer ecommerce + multi-location franchise systems that depended on cookie-based attribution found their lead-source attribution collapsing. The canonical response — server-side tagging via Google Tag Manager server container + per-platform Conversions API (Meta Conversions API + Google Enhanced Conversions + Microsoft UET Enhanced Conversions + TikTok Events API + LinkedIn Conversions API + Pinterest Conversions API + Snapchat Conversions API + Reddit Conversion API) + CHIPS partitioned-state cookies + FedCM + first-party-cookie persistence — preserves attribution but only when the lead-ingestion pipeline coordinates the click-ID preservation, the consent-state propagation, the cross-source deduplication, and the cross-source master-record merge end-to-end. The four-skill bundle on the Lead Scoring + Routing Agent — Capture, Resolve, Gate, Audit — sits above the 40+ lead-source surface and the 9+ CRM-destination surface and writes a per-lead canonical record with named regulatory citations preserved in the audit trail.

Why do Meta Lead Ads + Google Lead Form Extensions + TikTok Lead Generation + LinkedIn Lead Gen Forms + Typeform + Jotform + HubSpot Forms break at multi-location franchise scale?

Each lead-capture vendor ships a per-tenant per-form flat-submission primitive — one form, one webhook, one CRM drop. None coordinates click-ID preservation (gclid Google + fbclid Meta + msclkid Microsoft + ttclid TikTok + li_fat_id LinkedIn + twclid X / Twitter + epik Pinterest + Snap click ID + Reddit click ID + custom click ID) across the cross-source merge. None applies server-side tagging through the per-platform Conversions API to compensate for iOS 14.5 ATT signal collapse. None deduplicates across deterministic (hashed email + phone E.164 + customer ID) and probabilistic (Jaro-Winkler + Levenshtein + IP + device fingerprint) keys with a configured dedup window. None routes per-location under FDD Item 12 territorial protection. None enforces the consent stack (TCPA + 10DLC + CASL + CCPA / CPRA / 17-state opt-out + GDPR Article 22 + HIPAA when healthcare + FCRA + ECOA when credit decisioning) before the CRM emission fires. None writes a WORM record retaining the per-lead snapshot for the longest applicable regulatory window. The four-skill bundle Capture + Resolve + Gate + Audit sits above the lead-source and CRM surface — it does not replace them. Capture pulls from every source preserving click-IDs. Resolve dedups + master-record-merges + routes per-location. Gate enforces the regulatory stack. Audit writes the per-lead WORM record.

What does Capture do — 40+ source adapters + click-ID preservation + per-platform Conversions API server-side tagging?

Capture ingests from the 40+ standing lead sources via per-source adapter. Paid-social lead-capture (Meta Lead Ads Graph API + Google Lead Form Extensions API + TikTok Lead Generation API + LinkedIn Lead Gen Forms API + Pinterest Lead Ads API + Snapchat Lead Gen API + Reddit Lead Generation API). Form-capture (Typeform + Jotform + Gravity Forms + WPForms + Formstack + HubSpot Forms + Salesforce Web-to-Lead + Marketo + Unbounce + Instapage + Leadpages + ConvertKit). Phone + SMS + chat handoff (CallRail + CallTrackingMetrics + Marchex + Invoca + Twilio + Bandwidth + Plivo + Telnyx + Vonage + Intercom + Drift + Olark). Integration platforms (Zapier + Make / Integromat + Workato + Tray.io + n8n). Click-ID preservation across the 10 standing click-ID parameters (UTM source / medium / campaign / term / content + gclid Google + fbclid Meta + msclkid Microsoft + ttclid TikTok + li_fat_id LinkedIn + twclid X + epik Pinterest + Snap + Reddit + custom). Server-side tagging via Google Tag Manager server container + Meta Conversions API + Google Enhanced Conversions + Microsoft UET Enhanced Conversions + TikTok Events API + LinkedIn Conversions API + Pinterest Conversions API + Snapchat Conversions API + Reddit Conversion API. First-party cookie persistence + CHIPS partitioned-state cookies + Google Privacy Sandbox Topics API + Protected Audience API (FLEDGE) + Attribution Reporting API + FedCM. Per-source rate-limit + pagination + retry (exponential backoff + circuit breaker + dead-letter queue). Per-source confidence tier and explainability trace written into Audit.

What does Resolve do — deterministic + probabilistic deduplication + cross-source master-record merge + per-location routing under FDD Item 12?

Resolve runs three coordinated subsystems.

Per-lead deduplication: deterministic (shared email hashed SHA-256 + shared phone E.164 + shared customer ID + shared loyalty member ID) before probabilistic (fuzzy name Jaro-Winkler + Levenshtein + Damerau-Levenshtein + Soundex + Metaphone + fuzzy email typo detection + IP + device fingerprint + canvas + WebGL + AudioContext). Deduplication window across per-60-second + per-1-hour + per-24-hour + per-30-day with per-window confidence scoring.

Cross-source master-record merge: cross-source merge + survivorship rule + attribution-merge preserving first-touch + last-touch + multi-touch fingerprint + cross-source consent-state merge + cross-source LTV attribution aggregation.

Per-location routing: per-DID (Direct Inward Dialing) + per-ZIP code territory + per-IP geolocation + per-state territory + per-radius-from-store-pin + per-DMA + per-CBSA + per-customer-jurisdiction + per-FDD Item 12 territorial-rights attestation (when franchise system) + per-territory-overlap resolution + per-location routing fallback to corporate. LLM-augmented tie-breakers under per-vendor zero-retention (OpenAI + Anthropic) flag conflicts for operator review rather than auto-resolve. Per-decision confidence tier + explainability written into Audit.

What does Gate do — Apple ATT + Google Privacy Sandbox + CCPA / CPRA / 17-state + GDPR Article 22 + TCPA + 10DLC + CASL + FCRA + ECOA + FDD Item 12 + EU AI Act?

Gate evaluates five operationally distinctive anchors before any lead writes downstream. Anchor 1 (the most operationally distinctive — distinctive to post-cookie attribution): Apple App Tracking Transparency iOS 14.5 (April 26, 2021) + App Store Review Guideline 5.1.2 + IDFA opt-in; Google Chrome third-party cookie deprecation pivot to Privacy Sandbox user-choice model (July 2024) + Google Privacy Sandbox Topics API + Protected Audience API (FLEDGE) + Attribution Reporting API + FedCM + CHIPS partitioned-state cookies; Safari Intelligent Tracking Prevention + Firefox Enhanced Tracking Protection; per-platform Conversions API server-side tagging discipline (Meta Conversions API + Google Enhanced Conversions + Microsoft UET Enhanced Conversions + TikTok Events API + LinkedIn / Pinterest / Snapchat / Reddit Conversions API) with explicit consent propagation per call; FTC v X-Mode Social / Outlogic consent order January 2024 + FTC v Mobilewalla consent order December 2024 + FTC v Kochava + Massachusetts AG v Copley Advertising April 2017 location-data precedent when ingested lead carries precise-location signal. Anchor 2 (privacy + automated-decisioning): CCPA + CPRA right to opt out of automated decision-making + 17-state comprehensive privacy + Washington My Health My Data Act 2024 + Texas SCOPE Act 2024 + GDPR Article 6 lawful basis + Article 7 consent + Article 17 right to erasure + Article 22 automated decisions + LGPD + DPDP + PIPEDA + Quebec Law 25 + COPPA 15 USC 6501 for under-13 leads; consent-management platforms (OneTrust + Cookiebot + Usercentrics + Didomi + Sourcepoint + Quantcast Choice) propagate STOP / UNSUBSCRIBE / right-to-erasure cross-source cross-vendor. Anchor 3 (outbound channel + suppression discipline when ingested lead drives outbound): TCPA 47 USC 227 + FCC Declaratory Ruling FCC 24-18 March 2024 + prior-express-written-consent + 8am–9pm recipient-time-zone quiet hours + revocation + 14-state two-party-consent + state mini-TCPAs (Florida FTSA + Oklahoma TCPA + Washington CEMA); 10DLC A2P Campaign Registry + CTIA Messaging Principles; CASL 36-month suppression; Federal DNC + state DNC + Telemarketing Sales Rule; CAN-SPAM. Anchor 4 (credit + anti-discrimination + vertical): FCRA when lead drives credit decisioning + prescreen + permissible purpose + adverse-action notice; ECOA Regulation B disparate-impact when AI-ML lead-routing routes based on caller-area-code or demographic proxy; Fair Housing Act; GLBA Safeguards Rule; HIPAA 45 CFR 164.502 + 164.504 BAA + 164.514 + 164.308 + 164.312 when healthcare lead form; FINRA Rule 2210 + Rule 3110 + SEC Reg S-K when financial-services lead; FDA 21 CFR Part 11 + DSCSA when FDA-regulated. Anchor 5 (franchise + AI-governance): FDD Item 12 territorial-protection per FTC Franchise Rule 16 CFR 436 + 15-state franchise registration + state franchise relationship laws + FDD Item 17 + 19; CFPB UDAAP; FTC Section 5 + Pfizer 1972 substantiation + FTC Endorsement Guides 16 CFR Part 255; EU AI Act Article 22 + 26 + 50 + Article 13 + 14 + 15 when AI-ML routing or AI spam detection participates; Digital Services Act; NIST AI Risk Management Framework; ISO 42001; per-vendor LLM zero-retention verified per call. Policy-as-code expression via OPA Rego + AWS Cedar + Casbin + Cerbos + Oso + Styra DAS + Permit.io.

What does Audit do — per-lead WORM record + CRM emission across 9+ destinations + end-to-end replay?

Audit writes a per-lead WORM record at every Capture event + every Resolve decision + every CRM emission: per-lead ID + per-source pointer + per-banner pointer + per-location pointer + UTM + 10 click-ID parameter snapshot + first-touch + last-touch + multi-touch attribution trace + Conversions API server-side tagging evidence per platform + deduplication decision (deterministic + probabilistic + window + confidence) + master-record merge decision (survivorship rule + attribution merge + consent merge + LTV aggregation) + per-location routing decision (DID + ZIP + IP + state + radius + DMA + CBSA + FDD Item 12 attestation when franchise) + spam-detection decision (honeypot + time-to-completion + rate-limit + CAPTCHA + disposable-email + temporary-phone + known-spam-IP + behavioral fingerprint + multi-LLM ensemble) + consent-state snapshot (TCPA + 10DLC + CASL + CCPA / CPRA opt-out + 17-state + GDPR Article 22 + HIPAA + FCRA + COPPA + per-state mini-TCPA) + per-anchor Gate decision with evidence + per-vendor LLM zero-retention verification + enrichment-handoff record + CRM emission record across the 9+ standing CRM destinations (Salesforce + HubSpot + Microsoft Dynamics 365 + Zoho + Pipedrive + Keap + ActiveCampaign + Copper + SugarCRM + Freshsales + Insightly + Nutshell + Apptivo + monday CRM + Method CRM) with exactly-once semantics + per-CRM emission status + per-CRM emission failure DLQ + sibling-handoff pointers. DSAR export on demand for CCPA Right to Know + CPRA right to correct + GDPR Article 15 right of access + GDPR Article 17 right to erasure + 17-state DSAR. Storage on AWS S3 Object Lock + Azure Blob immutable + Google Cloud Storage Bucket Lock + Wasabi compliance WORM. Retention stacks (longest applicable wins): 7-year FTC substantiation + 7-year IRS + 7-year FDD + per-state franchise registration + 7-year HIPAA medical record + 6-year SEC + 3-year FINRA 4511 + 3-year FINRA Rule 3110 + per-state two-party recording + 36-month CASL + GDPR Article 30 + CCPA 12-month look-back + EU AI Act Article 12 + SOC 2 CC7 / CC8. End-to-end replay rewinds Capture + Resolve + Gate + CRM emission with confidence tier and explainability at every stage. Sibling handoffs flow into the lead-capture-form related guide, the firmographic-enrichment-lead-routing sibling build-pillar (downstream enrichment consumer), the buyer-state-aware BANT scoring sibling build-pillar (downstream scoring consumer), the customer-data-graph agent (per-location per-channel per-brand CLV sibling), the rollup-reporting agent (per-location MMM-driven budget recommendation engine + per-location cross-channel attribution rollup siblings), and the Lost-Call Recovery Agent when phone or SMS handoff is involved.

Engage Completions on the lead-scoring-routing bundle

The Capture + Resolve + Gate + Audit four-skill bundle ships as the orchestration layer above your existing lead-source + CRM + server-side-tagging + consent-platform surface. Apple ATT + Google Privacy Sandbox + per-platform Conversions API + FTC location-data precedent + CCPA / CPRA / 17-state + GDPR Article 22 + TCPA + FCC 24-18 + 10DLC + CASL + FCRA + ECOA + FDD Item 12 + EU AI Act anchors are preserved in every per-lead audit record. Tier 1 Marketing Operations Audit scopes the bundle in two to three weeks; Tier 3 Fractional Digital Marketing Lead operates the bundle end-to-end.

Free — for the person who will build it

The Agent Build Spec Pack

Get the working spec behind the architecture on this page — skill decomposition, data contracts, and the acceptance tests that tell you the agent is actually done.

  • The four-skill decomposition applied to a real agent, with the input and output contract for each skill.
  • The data-fabric contract: what the agent reads, what it writes back, and how it stays consistent with every other agent reading the same record.
  • The acceptance tests — the specific assertions that separate a demo from an agent you can leave running.

Opens on this page immediately. No attachment, no waiting on an email.