I a have a file drop automation which is importing data into specific data extension - there is no subscriber info in the data and I do not want to set one to email address. What would be the best way to auto generate Subscriber Key?
1 Answer
I personally don't recommend SFMC providing Subscriber Key to your contacts. The only way you can identify/deduplicate your subscribers on import will still be on email address - which will change over time and generate duplicate records, and leading to inconsistent tracking history.
There is a number of methods to generate a unique identifier in SFMC, if you really insist on building this solution. I would use NewID() in a Query Activity you trigger in the context of your import, in following way:
- Import the file to a staging DE
- Lookup the email addresses that are not in your master contacts DE
- For these addresses, generate the NewID
- Add these records to your master contacts DE, with the newsy generated IDs being your Subscriber Key
-
1Had to build such a solution lately. One thing very important to consider: when you have to implement an automated contact delete process the data in the import data extension will not be deleted as this one won't have a contact key to tie it to the data model. So, unless you can be sure that you have at least daily imports you need to custom build a solution to cover this issue. The easiest way would be to finish your contact delete automation with an overwrite query that returns no rows as this will empty the data extension. Dirty, but it works Commented Jun 4, 2019 at 18:58
-
1That's a good point. I would suggest the import should be set to overwrite the staging DE each time. Commented Jun 4, 2019 at 19:01