I’ve been trying to substitute for a deprecated method which was in the OMS for 6.4 which is “TriggerEvent”. I now get the following error with the following code. in the new DMS 6.5. I’m not sure what’s the correct new method.
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();
Error
[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
Working Code in 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();
Ok, I finally had a chance to get back here and update this post. I was able to get this working in 6.5. Not sure if they are going to update the module or if they have plans to.
Firstly,
I had to remove the call to the TriggerEvent method. As well,the AnalyticsTracker no longer exists. It now uses PageEventData and Sitecore.Analytics.Tracker.CurrentPage;
And replace it with:
Also, had to update the SQL for the reviews that were posted for UI public view.
From:
To:
Hope this helps