DATA-MINING CONTACT ACTIVITY FROM SITECORE EXM CAMPAIGNS – PART 3

While Sitecore 9 brings much needed improvements to how contact activity is stored in Sitecore, it is still very helpful to learn how we can extract contact information from MongoDB to troubleshoot previous versions versions of Sitecore. To conclude our interactions data-mining series, I wanted to share probably the most useful query to get the list of interactions for a specific contact.

db.getCollection('Interactions').find({$and:
[{"Pages.0.CustomValues.ScExmHolder":{$exists:true}},
{"ContactId" : NUUID("99fdc08a-b044-4c58-86e9-27483e4e0132")}]})

This query will return a list of interactions for our contact using its ID. However, how do we obtain this ID if we only know its identifier/email. This is quite simple using Sitecore’s Experience Profile. Within the Experience Profile, we can search the contact by its email and look at how Sitecore forms the contact profile URL:

With this ID, we can use our MongoDB query and obtain a clean list of interactions for this contact only. This can be specially helpful if we find inconsistencies between what Sitecore shows in it’s dashboard and MongoDB which can lead to a rebuild of the analytics database. But, we will leave that topic for another day. 😉

Leave a Reply

Your email address will not be published. Required fields are marked *