Sitecore 7.5 DMS以编程方式跟踪目标

w

我目前正在尝试使用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用户可以为我指明正确的方向?

欢呼声,兆瓦

弗拉德·伊巴古(Vlad Iobagiu)

你能试一下吗 :

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] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法通过Sitecore 7中的DMS规则对访问进行计数

来自分类Dev

Sitecore 7 Analytics通过编程提高参与度

来自分类Dev

Sitecore 7的登台模块

来自分类Dev

Sitecore更新NameValueList以编程方式

来自分类Dev

在jboss 5和7之间以编程方式确定jboss的版本

来自分类Dev

iOS 7 / Xcode 5:以编程方式访问设备启动图像

来自分类Dev

Sitecore 7中的奇怪超时

来自分类Dev

以编程方式取消发布sitecore项

来自分类Dev

Sitecore-以编程方式清除用户的缓存

来自分类Dev

以编程方式对Sitecore访问布局进行定义

来自分类Dev

Sitecore MVC字段以编程方式更新

来自分类Dev

Sitecore 以编程方式比较项目版本

来自分类Dev

如何在Sitecore 7中为简单应用创建快捷方式?

来自分类Dev

Sitecore 7.2 MVC和DMS

来自分类Dev

Sitecore 7搜索-Search.ashx

来自分类Dev

Sitecore 7索引树列表Lucene

来自分类Dev

Sitecore 7如何使用类映射模板

来自分类Dev

Sitecore 7:按字段排序Lucene结果

来自分类Dev

Sitecore 7功能区添加链接

来自分类Dev

sitecore 7多数据源字段

来自分类Dev

Sitecore 7支持LINQ扩展

来自分类Dev

Sitecore 7搜索索引问题

来自分类Dev

Sitecore 7索引树列表Lucene

来自分类Dev

ASP.NET 5和Sitecore 8

来自分类Dev

Sitecore HTML5支持

来自分类Dev

以编程方式在Concrete5(版本7)的单个页面中呈现404。

来自分类Dev

设置Sitecore DMS全局cookie的到期时间

来自分类Dev

设置Sitecore DMS全局cookie的到期时间

来自分类Dev

如何在Sitecore中以编程方式创建项目