0

I'm having trouble configuring 'Predictive Intelligence' recommendations in email in specific relation to 'Same As Reference Item'. Does anyone have experience with this working correctly? How do you reference the (item=) in a dynamic way?

I have this sentence from some Salesforce documentation on scenarios: "These scenarios must point to a specific reference item(s) in order to work. This reference item is typically passed using an item=SKU or category=CATEGORY parameter in the recommendation call or email HTML.​" Does anyone have a working example of this?

I've tried testing

101866855=ProductCode

With Item=101866855

With ProductCode=101866855

But nothing seem to work.

To be more specific. What I'm trying to achieve is something like this...

In a campaign email about kid clothing, which we would send to our kid segment, we would want to show items other customers had viewed, who also viewed/purchased this specific kid toys or buggy

For the same email,I might want to use the category of a referenced item to display only other recommendations from the same category as that referenced item/ProductCode.

Hope this makes sense. If you have any questions please let me know

2
  • Do you want to use email recommendations or web recommendations inside emails? A lot people use web recommendations because they offer more flexibility Oct 17 '19 at 9:27
  • email recommendations inside emails
    – Duicug
    Oct 17 '19 at 13:56
1

Personal Opinion:

One thing i have to add first: Email Recommendations in Salesforce are really really bad, i encourage everyone to configure web recommendations and form them to email recommendations with gtl / ampscript.

First you have to make sure, that there are elements in that particular scenario you are describing. Therefore you would look inside the reporting of recommendations inside your specific business unit.

Path:

--> personalization Builder --> web recommendations / or email --> Reporting -> Business Unit --> Admin tools --> Lists --> enter ProductCode

There you will see stuff like alsoviews_skunumber, viewbought_skunumber and stuff like this. Next to it there is a number how many articles are in that scenario. When you do not see that scenario it won't probably have any items and the product / item has never been bought or visited by anyone.

Your recommendation call needs to inherit the unique parameter of the item. If you configured to use sku and productcode you will most likely have to put the sku value in there if not the productcode.

https://MID.recs.igodigital.com/a/v2/MID/testrecommendation/recommend.json?email=UNIQUENAMEOFCUSTOMER&item=101866855

You would need to include this code inside your email and get the response of this call via httpget or stuff like this. Then you need to parse the response and create the html / css around it. This has been covered in a different post that i will link here soon or because i did not find it, my approach for three elements:

%%[
var @MID
var @scenario
var @customer
var @locale
var @count
var @baseurl
var @finalURL
var @item

var @attribute1_1
var @attribute1_2
var @attribute1_3
var @attribute1_4

var @attribute2_1
var @attribute2_2
var @attribute2_3
var @attribute2_4

var @attribute3_1
var @attribute3_2
var @attribute3_3
var @attribute3_4


set @MID = "XXXXXXXXX"
set @scenario = "SITENAME"
set @customer = AttributeValue("_subscriberkey")
set @item = "aUniqueID"
/* some function to set locale */


set @count = 0

set @baseurl = CONCAT("https://",@MID,".recs.igodigital.com/a/v2/",@MID,"/",@scenario,"/recommend.json?email=")
set @finalURL = CONCAT(@baseurl,@customer,"&locale=",@locale_param,"&item=",@item)

set @json = HttpGET(@finalURL) 
]%%

{{.datasource JSONVar type=variable maxRows = 1}}
{{.data}}
{ "target" : "@json" }
{{/data}}

{{.datasource JSONItems type=nested maxRows = 3}}
{{.data}}
{ "target" : "JsonVar.Items" }
{{/data}}

%%[ 
SET @count = ADD(@count, 1)

IF @count == 1 THEN
/* you need to actually need to map this to the real fields of your product catalog */ 
set @attribute1_1 = TreatAsContent("{{JSONItems.attribute1}}") 
set @attribute1_2 = TreatAsContent("{{JSONItems.attribute2}}") 
set @attribute1_3 = TreatAsContent("{{JSONItems.attribute3}}") 
set @attribute1_4 = TreatAsContent("{{JSONItems.attribute4}}") 
ENDIF

IF @count == 2 THEN
set @attribute2_1 = TreatAsContent("{{JSONItems.attribute1}}") 
set @attribute2_2 = TreatAsContent("{{JSONItems.attribute2}}") 
set @attribute2_3 = TreatAsContent("{{JSONItems.attribute3}}") 
set @attribute2_4 = TreatAsContent("{{JSONItems.attribute4}}") 
ENDIF

IF @count == 3 THEN
set @attribute3_1 = TreatAsContent("{{JSONItems.attribute1}}") 
set @attribute3_2 = TreatAsContent("{{JSONItems.attribute2}}") 
set @attribute3_3 = TreatAsContent("{{JSONItems.attribute3}}") 
set @attribute3_4 = TreatAsContent("{{JSONItems.attribute4}}") 
ENDIF
]%%

{{/datasource}}

{{/datasource}}

Note that httpget consumes supermessages -> each email with a httpget call does consume one.

4
  • Hi Johannes, thanks for the answer. Can you please post the link
    – Duicug
    Oct 17 '19 at 13:55
  • I was searching for it and for some minute sand didnt find it asap. Maybe i'll post the code later on if i dont find it tomorrow ;) Oct 17 '19 at 13:58
  • Your MID is the number of your business unit that you can also see on the top of your marketing cloud instance. Be sure to configure WEB recommendations and NOT email recommendations. The link takes the mid twice per definition.Your link is wrong in 2 different aspects -> first it is a email recommendation. second the parameter is always first in front of the value. Oct 18 '19 at 11:02
  • @JohannesSchapdick - each email that call web recommendation consumes: 1 Supermessage for sending the email 2 Supermessages for requesting web recommendation (if no empty) So each email sended useing this approch costs 1 supermessage more then Email Raccomandation (costs 1 SM)
    – Frogmouth
    Nov 9 '19 at 1:07

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.