2

I am upgrading Sitecore 8.2 to Sitecore 9.3. While upgrading Sitecore.analytics.aggregation reference to target version 9.3, I'm getting the error The type or namespace 'AggregationProcessor' could not be found for the code. And to upgrade the below custom processor, we need to get the visit details (args.context.visit.sitename and args.context.visit.pages) and it is not available in the 'InteractionAggregationPipelineArgs'. How could i use Interaction and Contact to get the visit details?

 public class CentralLikeProcessor : AggregationProcessor
{
    private Guid LikeEventDefinitionId = Common.Constants.PageEvents.Like.Guid;

    protected override void OnProcess(AggregationPipelineArgs args)
    {
        Assert.ArgumentNotNull(args, "args");
        Log.Info("xDB Started CentralLikeProcessor event", this);
        if (args.Context.Visit.SiteName == "central" || args.Context.Visit.SiteName == "authoring")
        {
            if (args.Context.Visit.Pages == null)
            {
                return;
            }
            foreach (PageData page in args.Context.Visit.Pages)
            {
                if (page.PageEvents != null)
                {
                    var fact = args.GetFact<CentralLikes>();
                    foreach (var pageEvent in page.PageEvents.Where(p => p.PageEventDefinitionId
                                                                         == LikeEventDefinitionId))
                    {
                        var itemId = pageEvent.ItemId;

                        if (itemId != Guid.Empty)
                        {
                            var likeKey = new CentralLikeKey();
                            likeKey.ItemId = itemId;

                            var likeValue = new CentralLikeValue();
                            likeValue.Count = 1;

                            fact.Emit(likeKey, likeValue);
                        }
                    }
                }
            }
        }
        Log.Info("xDB Ended CentralLikeProcessor event", this);
    }
}

}

Could you please suggest me on how to upgrade the above code with Sitecore 9.3?

3
  • Welcome to Sitecore Stack Exchange. Not sure how your Custom processor implementation looks like, but could you try using InteractionAggregationPipelineProcessor from the Sitecore.Analytics.Aggregation namespace? If possible please add more details to the question. Apr 26, 2021 at 10:43
  • Thanks Cristi. 'InteractionAggregationPipelineProcessor' works for me but in order to upgrade the above custom processor, we need to get the visit details (args.context.visit.sitename and args.context.visit.pages) and it is not available in the 'InteractionAggregationPipelineProcessor'. How could i use Interaction and Contact to get the visit details? Apr 27, 2021 at 10:23
  • I have added also as answer, could you take a look at the link from the sitecore doc? Apr 27, 2021 at 10:30

1 Answer 1

0

For sitecore 9.3 you need to change so that your custom processor inherits from InteractionAggregationPipelineProcessor from the Sitecore.Analytics.Aggregation namespace.

You can take a look at the sitecore documentation on how to create and use an interaction aggregation processor class https://doc.sitecore.com/developers/93/sitecore-experience-platform/en/walkthrough--using-the-interactions-pipeline-to-aggregate-and-store-reporting-data.html#create-an-interaction-aggregation-processor-class_body

Your Answer

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

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