I have done the following:
- I created a new Dimension and Segment;
I created a class inheriting from PageEventDimensionBase:
public class ByProfilesEdited : PageEventDimensionBase { public ByProfilesEdited(Guid dimensionId) : base(dimensionId) { } public override IEnumerable<string> ExtractDimensionKeys(PageEventData pageEvent) { Assert.IsNotNull(pageEvent, "pageEvent"); List<string> result = new List<string>(); result.Add(string.Format("( {0} ) test! {1}", pageEvent.Name, pageEvent.Text)); return result; } public override bool Filter(PageEventData pageEvent) { Assert.IsNotNull(pageEvent, "pageEvent"); return true; } }
in Sitecore.ExperienceAnalytics.Aggregation.Config I added the following line:
< dimension id="< ID of my dimension >" type="< type of the class created above >" />
to Sitecore.ExperienceAnalytics.Aggregation.config, Sitecore.ExperienceAnalytics.Reduce.config and Sitecore.ExperienceAnalytics.WebAPI.config.
Finally, I register each Page Event like this:
// Register Page Event PageEventData pageEvent = new PageEventData(GlobalDefinitions.Analytics.Events.EditedProfile.Name) { Name = GlobalDefinitions.Analytics.Events.EditedProfile.Name, Text = GlobalDefinitions.Analytics.Events.EditedProfile.Description, Data = name, ItemId = person.Id }; try { currentPage.Register(pageEvent); } catch (Exception exception) { _logService.Error(string.Format("{0} pageevent not created in current Sitecore Instance", GlobalDefinitions.Analytics.Events.EditedProfile.Name), exception); }
My PageEvent is recorded successfully in the xDB database:
However, when I rebuild the Reporting Database, I only get the Long Running Requests in the ReportDataView.
QUESTION
Does anyone knows what I'm doing wrong? I decompiled and studied painstakingly the Sitecore.ExperienceAnalytics.dll, and I'm going to thoroughly dissect Sitecore.Analytics.Sql.dll next as all types of Page Events were working fine in it. I absolutely, positively need to show up custom Page Events in our Experience Analytics reports, and nothing I found online helped so far.
EDIT: I have since created a new Dimension and Segment and restarted the process from scratch - it is now working. I'm afraid I will not have the time to go back to the original problem and figure out what went wrong there.
SELECT * FROM Sitecore.Analytics.dbo.Segments WHERE DimensionID = '<yourid>'
? I have seen Analytics simply NOT process/aggregate into the reporting database because of a missing relationship here.