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
- 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
analytics
connection 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
Sitecore.xDB.base
. - Make sure that xDB and its tracking subsystem are enabled.
In Sitecore 8.1, bothXdb.Enabled
andXdb.Tracking.Enabled
should be set totrue
in the Sitecore.Xdb.config. - Tracking should also be enabled on site definitions.
In Sitecore 8.1, you should ensure thatenableTracking
is set totrue
for 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
Analytics.Robots.IgnoreRobots
andAnalytics.AutoDetectBots
tofalse
in 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
- Set
- 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) - 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