0

We are migrating our custom report code from 8.2 to 9.1 , In 8.2 we are using

public class PageEventProcessor : AggregationProcessor
{
    protected override void OnProcess(AggregationPipelineArgs args)
    {
        try
        {
            var fact = args.GetFact<PageEvent>();
            foreach (var page in args.Context.Visit.Pages)
            {
                foreach (var pEvent in page.PageEvents)
                {
                    if (pEvent.PageEventDefinitionId == new Guid(ResourceConstants.VideoViewsGoalId))
                    {
                        var eventkey = new EventKey
                        {
                            EventId = pEvent.PageEventDefinitionId,
                            Date = args.DateTimeStrategy.Translate(pEvent.DateTime),
                            ItemId = pEvent.ItemId,
                            PageId = page.Item.Id,
                            Source = pEvent.DataKey,
                            Description = pEvent.Text

                        };
                        var eventValue = new EventValue
                        {
                            Count = 1
                        };
                        fact.Emit(eventkey, eventValue);
                    }
                }
            }
        }
        catch (Exception ex)
        {
            Log.Error($"PageEventProcessor error-{ex.ToString()}", this);
        }
    }
}

However, when we reverse engineer the code for Sitecore.Analytics.Aggregation, we don't find the AggregationProcessor anymore. Is the approach changed?

Any pointers are much appreciated.

  • Do you have the requirement / spec for what the code should do? From reading it seems to be trying to register another goal event on a particular goal event? – Mark Gibbons May 27 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.