When I try implementing Creating Predictive Email Content, the generated recommendation (an image with a link) will use the catalog ProductLink field as the link URL. Is it possible to override such behavior?

Also: for prices the standard currency used is dollar, would it be possible to change it as desired?


So PI uses a version of Ampscript which is documented here:


These are the only ampscript which is supported within Email displays in Email Recommendations

You have two options to solve your use case. In your catalog populate a filed with the price and currency, so your catalog would have a custom field called EuroRegPrice/EuroSale Price and then You would supply the value '€ 50,00'

Then in the email display you would use %%EuroRegPrice%% as opposed to %%RegularPrice%%

The 2nd options is to use the ampscript from the doc above

and your display code would look something like

€ %%RegularPriceMain%%,%%RegularPriceFractional%%

regarding the link being used you can replace %%imagelink%% which any field from the catalog, but unsure what the use case would be here

An example using the default code would be

<div style="font-size:12px;color:black;width:150px; text-align:center;">
<img style="max-width:150px;" src="%%ImageLink%%">
%%[ if SalePrice &lt; RegularPrice then ]%%
<s>Regular Price: € %%RegularPriceMain%%.%%RegularPriceFractional%%</s><br>
<span style="color:red;">Sale Price: € %%SalePriceMain%%,%%SalePriceFractional%%</span>
%%[ else ]%%
€ %%RegularPriceMain%%.%%RegularPriceFractional%%
%%[ endif ]%%

If it's a personalization string, then, yes, you should be able to override it.

You have a wide range of AMPScript functions at your disposal.

Here's a quick example:


var @productName, @regularPrice, @salePrice, @productLink

set @productName = AttributeValue("ProductName")
set @regularPrice = AttributeValue("regularPrice")
set @salePrice = AttributeValue("salePrice")
set @productLink = AttributeValue("productLink")

set @productName = replace(@productName,"XL","Extra Large")
set @regularPrice = formatCurrency(@regularPrice,"de-DE")
set @salePrice = formatCurrency(@salePrice,"de-DE")
set @productLink = concat(@productLink,"&whee=1")

<p>Product: <a href="%%=redirectto(@productLink)=%%">%%=v(@productName)=%%</a><p>
<p>Regular Price: %%=v(@RegularPrice)=%%</p>
<p>Sale Price: %%=v(@salePrice)=%%</p>    
  • Hi Adam, I think that would work for normal email within marketing cloud mail module, I am referring to the predictive intelligence mail recommendation. In this case the system generates a statica image, meaning that the command <p>Product: <a href="%%=redirectto(@productLink)=%%">%%=v(@productName)=%%</a><p> would not be useful – sdmc01 Aug 6 '16 at 12:47
  • Then use the same philosophy with the %%imageLink%% personalization string (instead of ProductName) as referenced on Styling Predictive Email Displays – Adam Spriggs Aug 6 '16 at 13:03
  • Hi Adam, I tried the following: %%[var @ProductLink set @ProductLink = "http://www.google.com" ]%% <div> <img src="%%ImageLink%%" /> <p>Product: <a href="%%ProductLink%%">%%ProductName%%</a><p> <p>Regular Price: %%RegularPrice%%</p> <p>Sale Price: %%SalePrice%%</p> </div> ]%% The generated link still points to the catalog product url though: 7285441.recs.igodigital.com/rr/v2/57a860780200b56fc3000000/l/1/… Image url pi-templates.s3.amazonaws.com/production/… Thank you – sdmc01 Aug 8 '16 at 10:50
  • You aren't referencing the variable you set...see my example in the div for @productLink – Adam Spriggs Aug 8 '16 at 11:08
  • I am sorry but I really don't get it... referring to your example: '<div> <p>Product: <a href="%%=redirectto(@productLink)=%%">%%=v(@productName)=%%</a><p> <p>Regular Price: %%=v(@RegularPrice)=%%</p> <p>Sale Price: %%=v(@salePrice)=%%</p> </div>' this code will be rendered as an image (see here pi-templates.s3.amazonaws.com/production/…) so the link you are setting is not really clickable. Am I missing something? I thought the AMPscript could be used to override the catalog field that the PI system would use – sdmc01 Aug 8 '16 at 16:16

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.