Many of you will know that Marketo lets you download leads via either its paginated or bulk extract API endpoints. I'm not going to go into how to download leads using either method in this post.
What I am going to do is tell you about something that most people forget when they download leads - the deleted leads. If you don't download the deleted leads, you aren't getting an accurate picture of your database, and your analytics will be skewed (or possibly another word that sounds remarkably similar).
Take this as a simple example. Your downloaded database has 100,000 people, but your Marketo database is only showing 90,000 people. Why? Because you've not been accounting for deleted records (and probably merged records - but resolving that is the subject of another post). You can see how the balance of your analytics will rapidly fall apart with that kind of discrepancy.
Fortunately, Marketo provides an API endpoint specifically for this.
/rest/v1/activities/deletedleads.json
This endpoint lets you look back any number of days for deleted leads, however, according to Adobe, the dataset is pruned after 14 days, so make sure and download the deleted leads as part of your regular lead extract process (hopefully you're doing this daily).
My usual approach is to have an extra field in whatever database I'm downloading the lead data to. Something like a date field called isDeleted is usually my go to. It's short, descriptive, and accurate; the perfect field name!
Update the isDeleted field to the date of the download on all the records (by lead ID) in the data you've downloaded using the deleted leads API endpoint.
The approach of flagging records as deleted is preferable to doing a hard delete from your database as flagging ensures you retain relational integrity to any other Marketo data that you're downloading (e.g. activities, program membership etc). In turn, this means you can report on:
And because we've used a date rather than a Boolean field for our deletion flag we can also report on:
In summary... don't forget the deleted leads!