I have a personalization scenario in which we want to change a component (button label) based on a triggered goal. Not very difficult you would think, but the component exists on all pages. It's impossible to add the personalization rules to each and every page, so I'm looking for a way to implement the rule on component level.

Thank you!

  • Do you use the _StandardValue for setting the datsource for this component? Dec 5 '17 at 12:50
  • this should not be a problem if you are using datasources and each instance of the component is a different instance. Now if you are reusing the same instance for all pages it's not going to work for a single page personalization because it impacts the instance, which is used on all pages...
    – Diego
    Dec 5 '17 at 12:55
  • @ArtsemPrashkovich I think so, I'm not sure. How do I check this? It's a call to action button in the main navigation of the site. Dec 5 '17 at 12:57
  • @Diego, I'm not sure. I'm not familiar with this yet. Any way I can check or read about this kind of setup? Dec 5 '17 at 14:16
  • Seems similar to your problem @Stein pageditor.wordpress.com/2014/11/21/…
    – Diego
    Dec 5 '17 at 14:33

Better if you update datasource of the Component(e.g. Rendering) with a new field of "Rules" type. Create a new template, have a single field with Field Type (Rules) Inherit your datasource's template with this new template.

Now have a Rule placed on your datasource item. and execute it like this way:

public static bool MyRules<T>(this RuleList<T> ruleList, T ruleContext) where T : RuleContext
    if (ruleList.Rules != null && ruleList.Rules.Any())
        if (ruleList.Rules.All(x => x.Condition == null))
            return true;
            foreach (var rule in ruleList.Rules)
                if (rule.Condition == null) continue;
                var result = rule.Evaluate(ruleContext);
                if (ruleContext.IsAborted) return false;
                if (result) return true;

    return false;

Call it like:

var context = new RuleContext();

Now it should decide whether goal is achieved or not. if default rule does not work, do same with some custom Rule and i think it will work.


To achieve this component level personalization, You can use standard values of your page template. Please follow the below steps

  1. Create common page template for all pages
  2. Enable standard values for the page template
  3. Add presentation details to the standard values item and add the component where you do the personalization
  4. Now add the personalization rule(based on goal) to the component and assign the corresponding data source item to the component
  5. Once all the above steps are done. Create the page item based on page template which you created in step 1. For Every page item creation, the personalization on component is added automatically. This will ensure there is no need to add personalization on component for each page.

You can use Predefined Rules under the Personalization section of the Marketing Control Panel to configure them and then apply them.

See this thread for more details: Reusing a set of personalization rules?.

Well, instead of answering the question, then I propose this question should be most likely "closed" or marked as duplicate. As the post I referred to includes details and pictures.

That said, having been down voted for not "providing enough details". Here is more details:

Either open the Marketing Control Panel and create/modify the predefined rules there or within the desktop/content editor, go to this path:

/sitecore/system/Marketing Control Panel/Personalization/Predefined Conditions

Create the rule that you need for your component.

Then use the Marketing Control Panel to apply this newly created predefined rule on your component. That will at least reduce the effort dramatically. You do still have to apply the one simple, predefined rule, on the component. But you don't have to recreate the complexity of the rule every time.

  • I couldn't figure out how to apply the pre-defined rule to the component in Marketing Control Panel? Could you explain that? Aug 20 '18 at 16:14

Your Answer

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

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