更新:所以问题是我的应用程序 Global.asax.cs 不是从 Sitecore.Web.Application 派生的。
所以我刚刚安装了带有 MongoDB 2.6.11 的 Sitecore 8。
出于测试目的,我将下面的代码放在页面加载事件中,以激活我之前在 sitecore 中创建的目标。
通过部署和发布成功创建了目标。我还确认了目标的项目 ID 是正确的。
if (Sitecore.Analytics.Tracker.IsActive && Sitecore.Analytics.Tracker.Current.CurrentPage != null)
{
Sitecore.Data.Items.Item GoaltoTrigger = Sitecore.Context.Database.GetItem("{EDA8EA2C-7AF5-4D0F-AF76-A9C4E6BD7169}");
if (GoaltoTrigger != null)
{
Sitecore.Analytics.Data.Items.PageEventItem registerthegoal = new Sitecore.Analytics.Data.Items.PageEventItem(GoaltoTrigger);
Sitecore.Analytics.Model.PageEventData eventData = Sitecore.Analytics.Tracker.Current.CurrentPage.Register(registerthegoal);
eventData.Data = GoaltoTrigger["Description"];
Sitecore.Analytics.Tracker.Current.Interaction.AcceptModifications();
}
}
Session.Abandon();
遗憾的是,这不起作用,我在交互下看不到 xDB 中的目标。
我调查的其他事情是我的布局肯定有标签
<sc:VisitorIdentification runat="server" />
我的 Global.asax 实现 Sitecore.Web.Application
public class Global : Sitecore.Web.Application
然而没有运气。在 Mongo 中找不到交互(使用 mongo shell 和 roboMongo 查找集合)。我还缺少其他东西吗?
Sitecore 错误
ManagedPoolThread #3 16:43:00 INFO Job ended: Sitecore.ListManagement.Analytics.UnlockContactListsAgent (units processed: )
12980 16:43:05 INFO Cache created: '[no name]' (max size: 976KB, running total: 2918MB)
12980 16:43:05 INFO Cache created: '[no name]' (max size: 976KB, running total: 2919MB)
12980 16:43:05 INFO Cache created: '[no name]' (max size: 976KB, running total: 2920MB)
12980 16:43:05 INFO Cache created: '[no name]' (max size: 976KB, running total: 2921MB)
12980 16:43:05 INFO Cache created: '[no name]' (max size: 976KB, running total: 2922MB)
ManagedPoolThread #5 16:43:06 ERROR Failed to perform MaxMind lookup
ManagedPoolThread #5 16:43:06 ERROR Failed to perform GeoIp lookup for 127.0.0.1
Exception: Sitecore.Analytics.Lookups.CannotParseResponseException
Message: Unexpected format. Cannot parse the MaxMind response for IP address: 127.0.0.1
Source: Sitecore.Analytics
at Sitecore.Analytics.Lookups.MaxMindProvider.GetInformationByIp(String ip)
at Sitecore.Analytics.Lookups.GeoIpManager.GetDataFromLookupProvider(GeoIpHandle geoIpHandle)
12980 16:43:08 INFO Cache created: 'WebUtil.QueryStringCache' (max size: 19KB, running total: 2922MB)
2700 16:43:08 INFO HttpModule is being initialized
12360 16:43:08 INFO HttpModule is being initialized
7068 16:43:08 INFO HttpModule is being initialized
9940 16:43:10 INFO [Experience Analytics]: Reduce agent found zero segments to process
ManagedPoolThread #1 16:43:10 INFO Job started: Sitecore.ListManagement.Analytics.UnlockContactListsAgent
ManagedPoolThread #1 16:43:10 INFO Job ended: Sitecore.ListManagement.Analytics.UnlockContactListsAgent (units processed: )