8

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:

enter image description here

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.

5
  • 1
    Could this be related? sitecore.stackexchange.com/questions/183 Commented May 22, 2017 at 10:16
  • I already found a bug where not having GoalDefinitionID for your Page Event prevents it from processing further and corrected it, but alas this is not the final solution of my problems yet. I will try what the linked question suggests before digging deeper. Dear God Analytics can be really finicky. Commented May 22, 2017 at 10:35
  • 1
    And sorry, that question is not related. Thanks anyway though. Commented May 22, 2017 at 10:38
  • Does your Dimension ID show up in the Reporting database Segments table? 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. Commented May 22, 2017 at 19:40
  • 1
    just of curiousity, you might want to check this -> stackoverflow.com/a/20565442 Commented Jun 29, 2018 at 20:14

1 Answer 1

1

It's great to hear that you were able to resolve the issue by creating a new Dimension and Segment. Sometimes, when dealing with complex configurations and customizations in Sitecore, starting fresh can help identify and avoid potential issues that might have occurred during the initial setup.

For future reference, here are some general tips to ensure successful custom Page Event integration with Experience Analytics in Sitecore:

Configuration Validation:

Double-check the configuration files (Sitecore.ExperienceAnalytics.Aggregation.config, Sitecore.ExperienceAnalytics.Reduce.config, and Sitecore.ExperienceAnalytics.WebAPI.config) for correctness, especially the registration of your custom dimension.

Class Initialization:

Ensure that your custom class (ByProfilesEdited) is initialized correctly. Pay attention to the constructor and any dependencies it might have.

Dimension Key Generation:

Confirm that the ExtractDimensionKeys method in your custom dimension is generating dimension keys as expected. These keys are crucial for aggregating data in the reporting database.

Filtering Logic:

Review the Filter method in your custom dimension to ensure that it doesn't unintentionally filter out events that should be included in the analytics data.

Data Registration:

Verify that your custom Page Event data is registered correctly using the currentPage.Register(pageEvent) method. Check for any exceptions during registration.

Logging and Debugging:

Implement logging throughout your custom code to capture any errors or unexpected behaviors. You can use Sitecore's logging features to output diagnostic information.

By following these guidelines and incorporating thorough testing practices, you can ensure a smoother integration of custom Page Events with Sitecore Experience Analytics.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.