xDB is not Collecting Contacts and Interactions?

Hey everyone,  I'm configuring xDB in an existing Sitecore 8 environment.  I'm able to connect to MongoDB and open Experience Analytics and Experience profile.  I open the database in RoboMongo and see the associated databases were created.  However, after navigating to the site from multiple browsers, I don't see an interaction or contact data being collected.  I've updated the session end default timeout to one minute - still no luck.  Any recommendations on what to look for to resolve this?  Thanks in advance.

  • The issue can occur due to the following reasons:
    1) Layouts do not have the VisitorIdentification control:

    the <sc:VisitorIdentification runat="server" /> control for asp web forms layout
    the @Html.Sitecore().VisitorIdentification() control for MVC layout

    If you do not have the control, all your visitors are resolved as robots.

    2) The custom Global.asax class does not have the correct implementation of the Session_End method:

    There is the following code in the Sitecore.Web.Application:

    public void Session_End()
    {
    RaiseSessionEndEvent(this);
    }

    In Sitecore 7.5-8.0 data is saved on session ending, if the Session_End event is not implemented in your Global.asax file, nothing will be saved.
  • In reply to Sergey Plashenko:

    What Sergey said. Also, when browsing from localhost, you may also want to disable robot detection.

               <setting name="Analytics.AutoDetectBots">

                   <patch:attribute name="value">false</patch:attribute>

               </setting>

    To get analytics data to commit sooner (before session times out), you'll want to force a session end. I have an EndSession.aspx page that I keep around:

    <%

       Sitecore.Analytics.Tracker.Current.CurrentPage.Cancel();

       HttpContext.Current.Session.Abandon();    

    %>

  • In reply to Nick Wesselman:

    Hey , isn't Session.Abandon() alone enough? Why would you need to explicitly cancel the CurrentPage on the Tracker.Current? Just curious. Looking into some xDB collections issues right now and stumbled upon this conversation
  • In reply to Pavel Veller:

    Yo :)

    Been awhile, but IIRC I would end up seeing my /EndSession.aspx page in analytics if I did not cancel the current page, which was undesirable for my purposes (demoing the Path Analyzer and other analytics reporting).
  • In reply to Nick Wesselman:

    Yea, that makes sense! and I wish I was that good with replying based on notifications from the community site. Configured them to be auto-tagged and stashed away and so I am now permanently behind :)
  • HI Guys,

    My SC 8.1 instance is collecting data on my local environemnt, however when I deploy to test env. nothing is being collected.

    confirmed the site is connecting to the mongodb server, using username and password for each mongo db

    I keep getting these in the logs on Test :

    5000 15:54:43 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    5000 15:54:43 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    5000 15:54:43 ERROR Application error.

    Exception: System.Web.HttpException

    Message: Server cannot append header after HTTP headers have been sent.

    Source: System.Web

      at System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace)

      at System.Web.HttpHeaderCollection.Add(String name, String value)

      at Sitecore.Web.XFrameOptionsHeaderModule.EndRequestHandler(Object sender, EventArgs e)

      at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

      at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    4132 15:54:43 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    7420 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    7420 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    4212 15:54:41 INFO  HttpModule is being initialized

    4212 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    4212 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    4212 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    4212 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    4212 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    4212 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    4212 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    4212 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    7420 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    7420 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    7420 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    7420 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    6852 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    6852 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    6852 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    6852 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    6852 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    6852 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    6852 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    6852 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    6852 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    6852 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    216 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    216 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    6852 15:54:41 DEBUG [Analytics]: Tracker.IsActive == false. EndAnalytics pipeline is terminated

    6852 15:54:41 DEBUG Tracker is not initialized. ReleaseContact processor is skipped

    Any suggestions are greatly appreciated.

  • In reply to Jawad Sabra:

    Enable the following in Sitecore.Xdb.config file in Website\App_Config\Include folder
    <setting name="Xdb.Enabled" value="true" />
    <setting name="Xdb.Tracking.Enabled" value="true" />

    We ran into a similar issue where the Databases were create in MongoDB but no data was collected in the collections.
    One thing to note is that the data gets pushed to MongoDB on session end. You can set the session timout to 1 minute in web.config for development purpose

    Sometimes, the sitecore_analytics_index gets corrupted with the collection DB so it would be worth rebuilding the indices on CM and also the web index manually on CD node. (One should not manually build the CD indices as they get built automatically).

    Some tips: www.nonlinearcreations.com/.../Troubleshooting-Sitecore-8-XP-Analytics.aspx