1

I am trying to create two versions of our homepage for two different types of clients, based on their site tendencies. I can get the page to function as desired with either of the two client tendencies, but if the user satisfies both set of rules they are getting both sets of content instead of one or the other.

Is there a way to set some sort of recency preference where it will only show the most recently satisfied condition instead of both?

  • Can you elaborate on what you have implemented? One component with multiple conditions? Sitecore evaluates personalization rules in order until it finds one that satisfies the condition. – josedbaez Jul 23 at 17:29
  • Did you try AB testing and multivariant testing google.com/amp/s/jonathanrobbins.co.uk/2015/07/28/…? – Swati Gupta Jul 23 at 17:59
  • I am using two different sets of components that are on the same page. Only one set should ever show at any given time. For ex. client A satisfies one set of rules so they see layout A, but if they then also satisfy the other set of rules they are then seeing Layout A & B instead of one or the other. – Travis Jul 23 at 18:15
0

Sitecore Personalization engine will render the components because both set of rules are being satisfied. As far as I know, Sitecore does not store the information of when a condition has been satisfied because this is executed on the fly during rendering.

If both rules are being satisfied, in order for you to have only 1 set of rules to be rendered, you will need to implement a custom condition. The custom condition will have a global variable that will be shared across those rules.

Example, Rule A has been met, then set the global variable to true. Before having the Rule B to render, you should check if the global variable has been set to true. If yes, then Rule B should not be rendered.

From a previous project, I had make use of the HttpContext.Current.Items which allows me to pass in the flag.

enter image description here

Note that you can also try to add other conditions whereby you randomly render either Layout A or B if both set of rules are met.

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.