Controller to receive data and register Sitecore goals
public class PageEventController : Controller | |
{ | |
[System.Web.Mvc.HttpPost] | |
public JsonResult RegisterGoal(string goalId, string goalDescription) | |
{ | |
Item eventItem = Sitecore.Context.Database.GetItem(goalId); | |
var goal = new PageEventItem(eventItem); | |
if (!Tracker.IsActive) | |
Tracker.StartTracking(); | |
Sitecore.Analytics.Model.PageEventData eventData = Tracker.Current.CurrentPage.Register(goal); | |
eventData.Data = goal["Description"] + " " + goalDescription; | |
Tracker.Current.Interaction.AcceptModifications(); | |
return Json(new PageEventRequestResult() | |
{ | |
Success = true, | |
Message = "Successfully registered goal", | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Jonathan- Can you please tell me which dll holds this class -PageEventRequestResult