How can I set up a web recommendation that has different SCENARIOS for different customer segments?

Specification (simplified): When I visit a website with one web recommendations area i would like to achieve that males get a different SCENARIO than females. For example males should receive "Top Sellers" while females should receive "Last View Merge".

When i would outline a solution (XY-Problem) i would like to have one recommendation page and a rule engine for the SCENARIO ORDER (not the rule engine to exclude or include products / content). Meaning the web recommendation has an own logic.

What i do not want: Create a logic in the onlineshop that decides which recommendation link it takes depending on the customer attribute like "sex".

Why? This would result in a strong bond between salesforce recommendations and the logic of the webshop. Switching the recommendation engine to other providers would be increasingly difficult when you make that strong hard coded connection.

I created an idea for that some month / years ago. Any clue how this is possible without logic in the webshop?

Ideas i created in that matter:

Other Ideas that were added by me or that were posted on my demand:

  • My suggestion would be to start with setting Contact Attribute Affinity, and see if this improves your recommendations? Wouldn't that work? Feb 7, 2020 at 11:14
  • We have a lot of that in place, still you cannot make sure which scenario should be presented to a particular user. You still cannot change the scenario based on any user attribute. The only option is the scenario "User Affinities", but thats even something different as we would like to achieve, because thats only a scenario to all customers which is different itself. But not different scenarios to different customers. Feb 7, 2020 at 11:58
  • Still i would love to have a user group to talk in detail about possible use case scenarios and implementations of web recommendations and all possibilities that are to offer. I guess i am kinda experienced in that matter but you need to know if your assumptions and experience are correct or if there are hidden possibilities or stuff like that. I really would like to know the limits of the system and what i can expect from it. Today and in the future and if i have already used the full potential. Feb 7, 2020 at 12:16

1 Answer 1


Conceptually, you could do following:

  1. come up with a hashed contact identifier, you can use in context of e.g. browser cookies
  2. create a JSON code resource (In SFMC Cloud Pages), which takes this identifier as parameter (it should be passed via e.g. queryparameter), and returns appropriate pageid (mapped in an SFMC data extension), referring to recommendations configured (e.g. Home vs Home2 in example below): enter image description here
  3. code resource will be called in a java script, which first should check if we already have this pageid and contact identifier stored in a custom cookie, otherwise we pass the contact identifier to code resource, and store the response in a cookie (while setting an expiry date, ensuring we refresh the page id after X days)
  4. you take the pageid provided, and merge it into the URL used to fetch recommendations, selecting dynamically which recommendation you want to use for this specific page visitor:
$('head').append('<script src="https://[MID].recs.igodigital.com/a/v2/[MID]/' + pageid + '/recommend.js" type="text/javascript"></script>');

In case Home2 is the right match for the visitor, you end up calling: https://[MID].recs.igodigital.com/a/v2/[MID]/home2/recommend.js

  • Wouldn't this result in a "rule engine" in the webshop which i was ultimatively was trying to avoid? Step 2 is exactly that. Feb 7, 2020 at 12:37
  • Nope - check updated answer :-) Rule engine is a combination of SFMC Cloud Page JSON Code Resource and rules stored in SFMC DE Feb 7, 2020 at 12:44
  • To be fair, this is a quite valid workaround, but still a workaround. This would not result in an engine in the webshop but on a cloudpage. Step 2 would be immense if you plan to include any customer with marketing attributes and declare the specific output for that. Even though the marketing attributes could technically be processed from a dataextension which resides inside the marketing cloud. But still you would write a massive if then else or rule engine. Isn't there some built in functionality from salesforce to use it, and that is what i have expected. Feb 7, 2020 at 13:38
  • It would assume that Salesforce would deliver this: You make a call to the recommendation engine and the INTERNAL rule engine of that recommendation choses the right recommendation at that context (time, website, recommendation, state of cart, current clickpath, ...), which you can define in that scenario rule engine. I still upvote the answer because it is a somewhat good workaround but for me it still is unsatisfying. I hope you know what i mean. Feb 7, 2020 at 13:40
  • Step2: Would be actually something like a microservice that could also be planned completely outside the scope of salesforce, still i don't like the idea of it. You basically plan a very complex structure there that actually just acts like a routing service. Feb 7, 2020 at 13:58

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.