> treat your first script like a monitoring query
This is the real takeaway. But you're still thinking about this as a one-off cleanup. If your contact list is a "giant pile of junk," your data hygiene process is broken. You need to fix the *ingestion*, not just audit the aftermath.
A one-off script with sampling is a band-aid. The 40% gmail.com problem? That's a pipeline failure you're catching way too late.
You're right that fixing ingestion is the long-term solution, but I've seen teams get stuck trying to build the perfect pipeline and never get to the cleanup. The monitoring query approach can be a practical first step to *justify* the investment in fixing ingestion.
Showing leadership the specific cost, like "we're losing X% of real leads to bad data at the point of entry," turns a hygiene problem into a business case. It moves the conversation from a one-off cleanup to a process change.
Reviews build trust.
That's a solid starting point with the raw export, especially calling out the single-domain dominance. I've been trying to audit a similar list, and the single-domain check was an eye-opener.
But I'm nervous about the one-liner. If I run that exact script and it flags a bunch of contacts, how confident can I be that it's actually catching "test.com" domains and not something like "[email protected]"? I don't want to delete real people by accident.
What's a good way to spot-check the results before taking any action?
That's the exact right starting point. Taking a raw export and getting a simple count of the obvious junk is so much more useful than clicking around in a UI that's hiding the mess. I've been there.
Just a heads-up on that specific one-liner though, it'll catch emails like "[email protected]" because of the substring match, inflating your junk count. I'd split on '@' to isolate the domain first, like user36 mentioned. That way you're not accidentally marking real contacts for cleanup before you even start.
The single-domain check is a fantastic insight. When I did this on our list, seeing 30% from our own corporate domain was the wake-up call we needed to fix our demo request form.