Working Proof · Form / Email → CRM Lead Deduplication

Three copies of the same lead in your CRM—and double email sequences going out.

When web forms, inbound email, and partner referrals write straight into a CRM without normalization and merge logic, one buyer becomes three messy records, automated follow-ups fire twice, and missing phone numbers or roles never converge on a single contact.

Why raw form and email intake breaks CRM hygiene

FAILURE 01

3 CRM copies of the same prospect

One prospect submits a website form with leading spaces and mixed case, sends an inbound email with their phone number, and later retries the form with an uppercase address. Exact string lookups treat all three as separate leads.

FAILURE 02

Duplicate email sequences firing in parallel

When a second or third copy enters the CRM, outbound drip sequences enroll the same person again and round-robin assignment hands the same buyer to two reps—damaging trust before the first call happens.

FAILURE 03

Lost fields or falsely merged teammates

Naive deduplication either drops a duplicate that carried a missing phone number or job title, or merges on company domain and collapses two distinct buyers at the same organization into one broken record.

The fix: normalize first, match deterministically + fuzzy, merge missing fields

Email & E.164 phone normalization

Every incoming record is trimmed, lowercased, and validated before matching. Phone numbers strip extensions and punctuation, convert 00 prefixes and (0) trunk digits, and normalize into strict E.164 (+CC...).

Deterministic email + fuzzy phone dedupe

Incoming leads match first on normalized primary or alternate email, then run fuzzy phone matching (exact E.164, 10-digit national suffix across missing prefixes, and context-guarded SequenceMatcher typo checks).

Non-destructive missing-field merge

Duplicates that add missing CRM fields (like a phone number, job title, or alias email) are merged without overwriting populated canonical fields. Exact repeats with zero new data are dropped cleanly.

Same-domain account linking

Two colleagues from the same corporate domain (e.g. northstarops.com) stay separate contacts while being linked at the account level, avoiding both false merges and blind silos.

Input patternRaw sampleNormalized outputRule applied
email" [email protected] "[email protected]Trim whitespace, lowercase, validate format, extract corporate domain
phone (US local + ext)"415.555.0192 ext. 204"+14155550192Strip extension, apply default region +1, flag for fuzzy phone matching
phone (UK trunk zero)"+44 (0)20 7946 0821"+442079460821Remove national (0) trunk digit after +CC and enforce ITU-T E.164
phone (00 intl prefix)"0046 8 501 234 56"+46850123456Convert leading 00 dialing prefix to + and strip separators
company domain[email protected]same_domain:northstarops.com (L-001)Keep separate contact; link corporate domain (free webmail excluded)

Real execution output on 8 messy sample leads

Executed directly with python3 scripts/lead_dedupe_demo.py (Python 3 standard library only). The batch contains mixed-case and whitespace emails, international and local phone formats, 3 copies of Elena Vance (initial form submission, inbound email backfilling her phone, and an exact uppercase repeat), an alias-email duplicate of Marcus Chen matched by fuzzy phone to backfill his role, and a separate colleague at northstarops.com who stays distinct.

Incoming leads

8

Kept (unique CRM)

5

Merged (fields filled)

2

Dropped (exact repeat)

1

Run 1 — Per-lead deduplication log (8 raw submissions)

RowSourceNameNormalized emailPhone (E.164)OutcomeLead IDDetail
1website_formElena Vance[email protected]-keptL-001new contact
2contact_formMarcus Chen[email protected]+14155550192keptL-002new contact
3inbound_emailElena Vance[email protected]+16465550148mergedL-001match=email; filled=phone
4website_formDavid Kim[email protected]+16465550173keptL-003new contact (same_domain:northstarops.com (L-001))
5partner_emailMarcus Chen[email protected]+14155550192mergedL-002match=phone_fuzzy; filled=role,alt_email
6demo_formPriya Nair[email protected]+442079460821keptL-004new contact
7website_formElena Vance[email protected]+16465550148droppedL-001match=email; exact repeat (no new fields)
8inbound_emailSofia Lindqvist[email protected]+46850123456keptL-005new contact

Final clean CRM table — 5 unique leads

Lead IDNamePrimary emailPhone (E.164)CompanyRoleSourcesAccount link
L-001Elena Vance[email protected]+16465550148Northstar OpsHead of Operationswebsite_form, inbound_email-
L-002Marcus Chen[email protected]+14155550192BrightPeak LabsCTOcontact_form, partner_email-
L-003David Kim[email protected]+16465550173Northstar OpsVP Saleswebsite_formsame_domain:northstarops.com (L-001)
L-004Priya Nair[email protected]+442079460821Kestrel OpsOperations Directordemo_form-
L-005Sofia Lindqvist[email protected]+46850123456Nordic FreightCOOinbound_email-

Verbatim stdout (including idempotent Run 2 replay)

Run 2: 0 kept · 0 merged · 8 dropped · 5 leads unchanged
=== Run 1: Incoming Lead Intake Log (8 raw form/email submissions) ===
| Row | Source | Name | Normalized Email | Phone (E.164) | Outcome | Lead ID | Detail |
| --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | website_form | Elena Vance | [email protected] | - | kept | L-001 | new contact |
| 2 | contact_form | Marcus Chen | [email protected] | +14155550192 | kept | L-002 | new contact |
| 3 | inbound_email | Elena Vance | [email protected] | +16465550148 | merged | L-001 | match=email; filled=phone |
| 4 | website_form | David Kim | [email protected] | +16465550173 | kept | L-003 | new contact (same_domain:northstarops.com (L-001)) |
| 5 | partner_email | Marcus Chen | [email protected] | +14155550192 | merged | L-002 | match=phone_fuzzy; filled=role,alt_email |
| 6 | demo_form | Priya Nair | [email protected] | +442079460821 | kept | L-004 | new contact |
| 7 | website_form | Elena Vance | [email protected] | +16465550148 | dropped | L-001 | match=email; exact repeat (no new fields) |
| 8 | inbound_email | Sofia Lindqvist | [email protected] | +46850123456 | kept | L-005 | new contact |

Run 1 summary: inputs=8, kept=5, merged=2, dropped=1, unique_leads=5

=== Final Clean CRM Table (5 unique leads) ===
| Lead ID | Name | Primary Email | Phone (E.164) | Company | Role | Sources | Account Link |
| --- | --- | --- | --- | --- | --- | --- | --- |
| L-001 | Elena Vance | [email protected] | +16465550148 | Northstar Ops | Head of Operations | website_form, inbound_email | - |
| L-002 | Marcus Chen | [email protected] | +14155550192 | BrightPeak Labs | CTO | contact_form, partner_email | - |
| L-003 | David Kim | [email protected] | +16465550173 | Northstar Ops | VP Sales | website_form | same_domain:northstarops.com (L-001) |
| L-004 | Priya Nair | [email protected] | +442079460821 | Kestrel Ops | Operations Director | demo_form | - |
| L-005 | Sofia Lindqvist | [email protected] | +46850123456 | Nordic Freight | COO | inbound_email | - |

Run 2 (idempotent re-run): inputs=8, kept=0, merged=0, dropped=8, unique_leads=5, unchanged=True
Assertions passed: 8 inputs -> 5 unique leads (5 kept, 2 merged, 1 dropped); re-run unchanged.

Want clean lead deduplication wired into your CRM?

Tell us your intake channels (forms, email, webhooks) and CRM schema. We scope every build around your stack on a short call and send a tailored quote in USD.