5

8.2 update 0. I have changed session to be 1 minute instead of the default 20 minutes. When I log into the site, in incognito, surf around and close the browser. No contact is ever created in the Mongo analytics database.

enter image description here

When I look in the logs, there is nothing before or after the profile is created to identify any issues. I have installed a profile viewer and can verify that a profile is being created and has custom facets. I just can get it to write the contact to Mongo when the session is closed.

I have tried several different browers on and off server.

5
  • Can you post code showing how you identify and or create the user? Dec 8, 2016 at 0:24
  • Just normal Sitecore xDB. I just did a SIM site, xDB worked. Deployed my code, no xDB. Removed App_Config changes, xDB works. Now to find the config file causing the issue.
    – Chris Auer
    Dec 8, 2016 at 0:26
  • oh I see, your contact collection isn't even being created. You'll want to make sure the config that sets up the Contact Repository is enabled. Um, I think it's the Sitecore.Analytics....... I don't recall, but definitely in that family. Dec 8, 2016 at 0:28
  • 1
    Is the VisitorIdentification code available on layout? <ensureSessionContext patch:source="Sitecore.Analytics.Tracking.config"> this pipeline is responsible for creating the contact if it helps.
    – phani
    Dec 8, 2016 at 5:38
  • You're dead on @phani. Post that as a question and I'll mark it answered. Keep believe I forgot that.
    – Chris Auer
    Dec 8, 2016 at 7:03

4 Answers 4

11

I know you have already found the exact solution for your particular case. Still, I'm going to list the steps I normally take when troubleshooting data saving issues in xDB. Hopefully, this can help others in the future.

  1. Ensure the analytics connection string is set up properly in the ConnectionStrings.config.
  2. Make sure that you have a valid xDB license. You can see the list of available licenses in the Control Panel > Administration > Installed licenses. "Sitecore.xDB.base" should be present there.
  3. Make sure that xDB and its tracking subsystem are enabled. The settings Xdb.Enabled and Xdb.Tracking.Enabled should be set to true when you open this page: /sitecore/admin/ShowConfig.aspx.
  4. The configuration file Sitecore.Analytics.Tracking.Database.config should be enabled.
  5. Enable tracking on your site definition by setting enableTracking to true for your site in the <sites> section.
  6. Try making several page requests instead of just one before letting the session expire.
  7. Ensure that all of your layout pages contain the VisitorIdentification control in the <head> section.
    • In MVC layouts, use @Html.Sitecore().VisitorIdentification();
    • in ASP.NET WebForms layouts, use <sc:VisitorIdentification runat="server" />.
  8. Try disabling robot detection by setting both Analytics.Robots.IgnoreRobots and Analytics.AutoDetectBots to false. The original values for these settings are located in the Sitecore.Analytics.Tracking.config. If interactions are saved after this, it means your visitors were recognized as robots.
  9. If nothing helps, go through the steps listed in the article Troubleshooting xDB data issues.
1
  • 1
    @dnstommy mark this as answer. This has detailed explanation on what and all to be checked for your question.
    – phani
    Dec 8, 2016 at 14:33
4

Ensure the VisitorIdentification code is available on the layout.

@Html.Sitecore().VisitorIdentification()

Also, if it helps, the contact creation logic is executed in the below pipeline processor:

<ensureSessionContext>
...
  <processor type="Sitecore.Analytics.Pipelines.EnsureSessionContext.CreateContact, Sitecore.Analytics">
    <ContactManager ref="tracking/contactManager" />
  </processor>
...
</ensureSessionContext>
0

A couple more steps that were missing in my particular scenario:

  1. The Global.asax file must inherit from Sitecore.Web.Application:

    <%@Application Language='C#' Inherits="Sitecore.Web.Application" %>
    
  2. If using Global.asax.cs instead, follow the same inheritance structure:

    public class Global : Sitecore.Web.Application
    {
        protected void Application_Start(object sender, EventArgs e)
        {
    
        }
    }
    
  3. For testing purposes it's helpful to reduce the session timeout in Web.config:

    <sessionState mode="InProc" cookieless="false" timeout="1">
    

I've found the Global.asax tip in an article on Creating a Visual Studio Project for Sitecore MVC.

-1

If you have enabled tracker then you should be able to see values stored in MongoDB. But few steps you need to verify again.

  1. Check both settings enabled in Sitecore.Xdb.config:

    setting name="Xdb.Enabled" value="true" 
    
    setting name="Xdb.Tracking.Enabled" value="true" 
    
  2. ClusterName and Hostname should be Unique Name/Host Name in Sitecore.Analytics.Tracking.config:

    setting name="Analytics.ClusterName" value="siteName"
    
    setting name="Analytics.HostName" value="siteName"
    
  3. After making sure all steps configured you can also try my blog for further steps to push data in contact DB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.