Dedupe overlapping state and national packages
The overlap is by design
The national pack is the union of all published state packs — every state record appears in it exactly once. If you bought Texas and then bought the national file, the Texas agents are not duplicates of a second product; they are the same records in the larger set.
Within one file, producer_id is unique
Each contacts.csv already dedupes internally: one row per agent keyed on producer_id. You never need to dedupe a single pack — the release guarantees one row per person per file.
Across purchases or editions
Key everything on producer_id, not email — it is stable across editions and across packs, while people change emails.
To merge a state pack into a national import, join on producer_id and keep the national row — same person, same fields, one record.
When a new edition ships, treat it as an update: re-key on producer_id so existing CRM records get refreshed rather than recreated.
- Dedupe key: producer_id.
- Fallback for records you collected elsewhere: exact email match, never name-only.
- Never fuzzy-match on name plus state — same-name collisions are common in this data.
A note on shared contacts
Distinct people can share an office inbox or phone line, so deduping on contact value would wrongly merge different agents. producer_id separates the person from the contact channel — that is why the file ships uniqueEmails and uniquePhones as separate counts from the agent total.