我目前正在尝试使用sitecore DMS跟踪sitecore 7.5中的按钮单击,我在互联网上找到了大量信息,但是大多数信息是在7.5之前转换到MongoDB之前的...
以前看起来像这样:
//Check that analytics are on...
if (Sitecore.Analytics.Tracker.IsActive && Sitecore.Analytics.Tracker.CurrentPage != null)
{
//Get the item goal.
Item goalItem = Sitecore.Context.Database.GetItem("{xxxxx-xxx-xxx-xxxxx}");
//Page event wrapper
PageEventItem goal = new PageEventItem(goalItem);
//Create the record that needs to store the goal
VisitorDataSet.PageEventsRow pageEventsRw = Sitecore.Analytics.Tracker.CurrentPage.Register(goal);
//this is not mandatory
pageEventsRw.Data = "custom text";
Sitecore.Analytics.Tracker.Submit();
}
我想在Sitecore 7.5中实现这种目标,但努力在Internet上查找大量资源,想知道是否有任何高级Sitecore用户可以为我指明正确的方向?
欢呼声,兆瓦
你能试一下吗 :
if (Sitecore.Analytics.Tracker.IsActive && Sitecore.Analytics.Tracker.Current.CurrentPage != null)
{
Sitecore.Data.Items.Item GoaltoTrigger = Sitecore.Context.Database.GetItem("{Item ID of the Goal}");
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();
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句