我一直在尝试替换 6.4 的 OMS 中已弃用的方法,即“TriggerEvent”。我现在使用以下代码收到以下错误。在新的 DMS 6.5 中。我不确定什么是正确的新方法。
var tracker = Sitecore.Analytics.Tracker.Visitor.CurrentVisit.CurrentPage;
if (tracker != null)
{
string dataXml = Review_Module.sitecore_modules.Review_module.Classes
.AnalyticsHelper.FillDataField(new string[]
{
"Title", title, "Description", description, "Rate", rate
});
PageEventData eventData = new PageEventData("Review");
eventData.Data = dataXml;
VisitorDataSet.PageEventsRow pageEventsRow = Sitecore.Analytics.Tracker.CurrentPage.Register(eventData);
Sitecore.Analytics.Tracker.Submit();
错误
[PageEventDefinitionNotFoundException: The page event definition Review could not be found.]
Sitecore.Analytics.Data.DataAccess.DataSets.PagesRow.Register(PageEventData data) +170
Sitecore.Analytics.Data.DataAccess.DataSets.PagesRow.Register(String name, String text, String dataKey, String data) +127
ReviewModule.Nicam_Modules.Review_module.Controls.Review.ReviewClicked(Object sender, EventArgs e) +808
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +111
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +79
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
6.4 OMS 中的工作代码
string dataXml = Review_Module.sitecore_modules.Review_module.Classes.AnalyticsHelper.FillDataField(new string[]
{
"Title", title, "Description", description, "Rate", rate
});
tracker.CurrentPage.TriggerEvent("Review", "Review: \"" + Sitecore.Context.Item.Name + "\"", string.Empty, dataXml);
tracker.Submit();