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.
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:
a) Added a new provider:
a) for GeoIP- to get pass the Load Balancer the real IP of visitor.
b) Add a new provider and use it
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/.
For #xDB troubleshoot here is a short list collected from stack overflow , from kb.sitecore.net and from Sitecore documentation
- Ensure that all of your layout pages contain the tag (@Html.Sitecore().VisitorIdentification() helper for MVC websites) in thesection.
- Make sure your Global.asax inherits from Inherits=“Sitecore.Web.Application”
- Make sure that the
analyticsconnection string is set properly.
- 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
- Make sure that xDB and its tracking subsystem are enabled.
In Sitecore 8.1, both
Xdb.Tracking.Enabledshould be set to
truein the Sitecore.Xdb.config.
- Tracking should also be enabled on site definitions.
In Sitecore 8.1, you should ensure that
enableTrackingis set to
truefor your site in the Sitecore.config.
- Try making several page requests instead of just one before letting the session to expire.
- Try disabling robot detection by setting both
falsein the Sitecore.Analytics.Tracking.config. If interactions are saved after this, I will update my answer with further instructions.
- If nothing helps, go through the steps listed in the article
- Check is in Mongo DB we have interaction and data. To find your contact and interaction I used this query in mongo:
- 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