Sitecore MongoDB – What do we know about a contact?

The Sitecore Analytics can be somewhat of a black box. All we know is that Sitecore stores everything about a site visitor in a Contact object and stuffs it into MongoDB when the visitor session expires.

A while ago my colleague Lasse Pedersen gave me the following scripts to be executed in RoboMongo to debug and see what Sitecore does know about my contact. The script is especially useful when working with named contacts. Replace the IDENTIFIER_NAME with the name of your contact and run it inside RoboMongo:

identifier = db.Identifiers.findOne({_id: /IDENTIFIER_NAME/i});
contact = db.Contacts.findOne({_id: identifier.contact});
classifications = db.ClassificationsMap.findOne({_id: contact._id });
userAgents = db.UserAgents.find({_id:{$in: classifications.Classificators.UserAgents}});
devices = db.Devices.find({LastKnownContactId: contact._id});
interactions = db.Interactions.find({ContactId: contact._id});

So what does the scripts return?

CONTACT IDENTIFIER

Contact Identifier

Contact Identifier

This is just the identifier information.

CONTACT

Contact Contact

Contact Contact

This is the complete Contact object, including all the Contact Facets that you have added yourself.

CONTACT CLASSIFICATIONS

Contact Classifications

Contact Classifications

This is the data that helps Sitecore identify if the current contact is a human or a robot.

 CONTACT USERAGENTS

Contact Useragents

Contact Useragents

Here you will find the reference to the user agent data, and the information as to whether the contact was indeed identified as a human or a robot.

CONTACT DEVICES

Contact Devices

Contact Devices

A device is essential the cookie that was used when the user interacted with the website. Sitecore will use these data to merge contacts as it links one Contact to every device used.

CONTACT INTERACTIONS

Contact Interactions

Contact Interactions

This is each interaction that the contact have had with the website.

MORE TO READ:

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in Sitecore 8. Bookmark the permalink.

1 Response to Sitecore MongoDB – What do we know about a contact?

  1. Pingback: Sitecore contact cannot be loaded, code never responds | Brian Pedersen's Sitecore and .NET Blog

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.