Sitecore Analytics #xDB troubleshoot and #mongosession configuration

During troubleshooting of xDB  not recording data of a upgraded Sitecore 8.1 solution  I learned several stuff and I want to share that with you.

Our problem was related with the website definition , it did’t had enableTracking="True" and Global.asax was altered .

Then , when solution was working fine on QA , when we deploy it on production in a load balancer environment with 2 CD we had issues with the session, (sticky session),Geo IP   and contact facets no being detect and  saved in xDB. This one was fixed by enabling out of process  for both sessions private and shared in Mongo DB.

Enabling #mongosession

For enabling mongo #session we followed this approach : Content delivery cluster with a non-sticky load balancer.

We set the private session state  in web.config and shared session state in Sitecore.Analytics.Tracking.config

Changes we did:

Web.config

a) Added a new provider:

 Sitecore.Analytics.Tracking.config

a) for GeoIP- to get pass the Load Balancer the real IP of visitor.

b) Add a new provider and use it

………………………………..

Connectionstrings.config

Added the connection string  to mongo session DB:

To read and understand more about #xDB session check Martina’s  blog https://mhwelander.net/2016/05/19/lets-talk-about-session-state/.

and this Sitecore docs https://doc.sitecore.net/sitecore_experience_platform/setting_up__maintaining/xdb/session_state/session_state

Troubleshooting  #xDB 

For #xDB troubleshoot  here is a short list collected from stack overflow , from kb.sitecore.net and from Sitecore documentation

  1. Ensure that all of your layout pages contain the tag (@Html.Sitecore().VisitorIdentification() helper for MVC websites) in thesection.
  2. Make sure your Global.asax inherits from Inherits=“Sitecore.Web.Application”
  3. Make sure that the analytics connection string is set properly.
  4. Make sure that you have a license for xDB. You can see the list of available licenses in Sitecore Control Panel –> Administration –> Installed licenses. In Sitecore 8.1 it’s Sitecore.xDB.base.
  5. Make sure that xDB and its tracking subsystem are enabled.
    In Sitecore 8.1, both Xdb.Enabled and Xdb.Tracking.Enabled should be set to true in the Sitecore.Xdb.config.
  6. Tracking should also be enabled on site definitions.
    In Sitecore 8.1, you should ensure that enableTracking is set to true for your site in the Sitecore.config.
  7. Try making several page requests instead of just one before letting the session to expire.
  8. Try disabling robot detection by setting both Analytics.Robots.IgnoreRobots and Analytics.AutoDetectBots to false in the Sitecore.Analytics.Tracking.config. If interactions are saved after this, I will update my answer with further instructions.
  9. If nothing helps, go through the steps listed in the article
  10. Set
  11. Check is in Mongo DB we have interaction and data. To find your contact and interaction I used this query in mongo:
    db.Contacts.find().sort({_id:-1})
    db.Interactions.find().sort({SaveDateTime:-1}).limit(10)
  12. I created a script page that create a contact facets ,identify it , show analytics cookie id , asp.net cookie  , contact facets data, and ends session for testing purpose
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s