使用指定用户登录后,Sitecore Tracker 为空

Sitecore Tracker is null after login with specified user

我怀疑 Sitecore.Analytics.Tracker 以及 sitecore 如何跟踪用户信息。 这是我正在使用的当前版本 - Sitecore.NET 8.1 (rev. 160519) with MVC

我有一个登录页面,我在其中对 sitecore 进行手动登录,Tracker.Current 始终为空。

我想为登录用户创建一个联系人,或者验证是否有联系人,以填写用户信息。

在 showconfig.aspx 中搜索了 Analytics.Enabled,但没有结果。所有数据库连接字符串都正确。

提前致谢。

代码示例:

string domainUser = Sitecore.Context.Domain.GetFullName(model.Username);

if (System.Web.Security.Membership.GetUser(domainUser) != null)
{         
   bool logged = AuthenticationManager.Login(domainUser, model.Password, false);
   ....
}

更新:

ViewBag.XdbSettings = "Empty";
if (XdbSettings.Enabled)
    ViewBag.XdbSettings = "Enabled";

ViewBag.HasValidLicense = "Empty";
if (XdbSettings.HasValidLicense)
    ViewBag.HasValidLicense = "HasValidLicense";

ViewBag.Tracking = "Empty";
if (XdbSettings.Tracking.Enabled)
    ViewBag.Tracking = "Enabled";

ViewBag.Comment = "Empty";
if (Tracker.Current != null)
    ViewBag.Comment = "Not Null";


XdbSettings: Enabled
HasValidLicense: HasValidLicense
Tracking: Enabled
Comment: Empty

在 Sitecore 8.1 中,您要查找的设置的名称已更改为 Xdb.Enabled。您应该检查 Xdb.EnabledXdb.Tracking.Enabled 是否存在并设置为 true。这些设置位于 App_Config/Include/Sitecore.Xdb.config.

此外,确认您有其他特定于 xDB 的配置文件,例如 Sitecore.Analytics.configSitecore.Analytics.Tracking.config.

此外,检查 enableTracking 属性是否设置为 true 用于 Sitecore.config.

中适当的 <site> 元素

此外,请关注 Sitecore 的 troubleshooting guide