Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Controller to receive data and register Sitecore goals
public class PageEventController : Controller
public JsonResult RegisterGoal(string goalId, string goalDescription)
Item eventItem = Sitecore.Context.Database.GetItem(goalId);
var goal = new PageEventItem(eventItem);
if (!Tracker.IsActive)
Sitecore.Analytics.Model.PageEventData eventData = Tracker.Current.CurrentPage.Register(goal);
eventData.Data = goal["Description"] + " " + goalDescription;
return Json(new PageEventRequestResult()
Success = true,
Message = "Successfully registered goal",
Copy link

abhaydhar commented Jul 1, 2016

Jonathan- Can you please tell me which dll holds this class -PageEventRequestResult

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment