I have created 2 goals and assigned 5 points to each goals. Now in Component level personalization, I want to compare engagement points of each goal and display the content based on the comparison, if goal1 has more points compare to goal2 then display the content accordingly.

Do we need custom personalization to implement such type of scenario?


1 Answer 1


You will require to implement a custom rule as there are no rules OOTB Sitecore that allows the comparison of total engagement value of goals. The current rules about the Sitecore goals are mainly attached to the contact.

To retrieve the goals total engagement value, you can do the following:

var goalDefinitionManager = ServiceLocator.ServiceProvider.GetDefinitionManagerFactory().GetDefinitionManager<Sitecore.Marketing.Definitions.Goals.IGoalDefinition>();

// Get by ID and culture. Will get the latest active version.
// Pass in boolean true or false as 3rd parameter to return the inactive goal or not
Sitecore.Marketing.Definitions.Goals.IGoalDefinition goalOne = goalDefinitionManager.Get(goalId, CultureInfo.InvariantCulture);

var totalEngagementValue = goalOne.EngagementValuePoints;

The above code will be used in your custom personalization rule. You may have a rule where you can configure the 2 goals then perform the comparison

So the rule will look like

Is Goal specific greater than Goal specific

The specific is a selection that allows you to select the Goal Id.


You'll need to configure the rule twice where you will alter the goal position in the rule.

More information about Goals can be found here.

  • Thanks for Code and giving the Idea .. let me try
    – Shailesh
    Sep 4, 2019 at 9:59

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.