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.
- Ensure the
analytics
connection string is set up properly in the ConnectionStrings.config. - 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 in that list.
- Make sure that xDB and its tracking subsystem are enabled. The settings
Xdb.Enabled
andXdb.Tracking.Enabled
should be set totrue
when you open this page:/sitecore/admin/ShowConfig.aspx
. - The configuration file
Sitecore.Analytics.Tracking.Database.config
should be enabled. - Tracking should also be enabled on site definitions—
enableTracking
should be set totrue
for your site in the<sites>
section. - Try making several page requests instead of just one before letting the session expire.
- 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,<sc:VisitorIdentification runat="server" />
- Try disabling robot detection by setting both
Analytics.Robots.IgnoreRobots
andAnalytics.AutoDetectBots
tofalse
. The original values for these settings are located in the Sitecore.Analytics.Tracking.config. If interactions are saved after this, it means your visitors are still recognized as robots. - If nothing helps, go through the steps listed in the article Troubleshooting xDB data issues.