如何获取 Sitecore 会话期间触发的活动和目标列表?
我无法识别通过我们网站的联系表与我们联系的访问者。该表单收集基本信息,但最好在电子邮件正文中包含一些 Sitecore Analytics 数据,以帮助描绘更大的情况。
为了实现这一目标,我需要以某种方式检索当前会话期间触发的所有活动和目标。
Sitecore API 提供了用于“触发”目标和活动的便捷方法,但我似乎找不到任何方法来检索当前会话所触发的内容。如果可能的话,我想避免直接查询 OMS 数据库。
非常感谢任何帮助。
I am having trouble identifying visitors who contact us through our website's contact form. The form collects basic information, but it would be nice to include some Sitecore Analytics data in the body of the email to help paint a bigger picture.
To achieve this, I would need to somehow retrieve all Campaigns and Goals triggered during the current session.
The Sitecore API provides convenient methods for "triggering" goals and campaigns, but I cannot seem to find any methods to retrieve what's been triggered for the current session. I would like to avoid querying the OMS database directly, if possible.
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以深入研究从
Tracker.CurrentVisit
返回的VisitorDataSet
对象,您应该能够获取一些有用的属性,然后提取相关数据。例如,这应该让您获得当前访问返回的活动(如果有相关活动)。
我没有经常使用它,但可能会让您朝着正确的方向前进,抱歉,我无法提供更多详细信息。
You can have a dig around in the
VisitorDataSet
object returned fromTracker.CurrentVisit
, you should be able to get at some useful properties and then extract relevant data.This, for example, should get you the campaign returned by the current visit (if there is a relevant campaign)..
I've not used this a lot but might get you going in the right direction, sorry I cant provide any more detail.
我无法得到建议的答案,但我找到了一个可行的解决方案!它应该与 Sitecore 6.5 到 7.2 相关(不确定 7.5 及更高版本)。您可以通过
Sitecore.Analytics.Tracker.DataContext
对象访问营销活动。将这些知识与 Stephen Pope 的答案相结合,我们得到:
我还关心获取活动的流量类型,您可以这样做:
I could not get the proposed answer to work, but I found a solution that does! It should be relevant for Sitecore 6.5 to 7.2 (not sure about 7.5 and beyond). You can access the campaigns through the
Sitecore.Analytics.Tracker.DataContext
object.Combining this knowledge with the Stephen Pope's answer, we get:
I also cared about getting the campaign's traffic type, which you can do like so: