Note: This is a guest post by Cathal Moran. Cathal is a Solutions Consultant, working out of Marketo’s EMEA Office in Dublin, Ireland.
Comparing Score fields
Many Marketo customers, particularly those focused on cross-selling, have multiple score fields and this is often used to measure a lead’s interest in a particular product /area.
Imagine I sell apples and bananas, if a lead has a score of 50 for apples and 10 for bananas then it’s clear where the preference lies, wouldn’t it be nice if my content reflected this preference.
Email scripting can be used to compare scores and to personalise content in an email depending what score is highest (or lowest) for that particular lead receiving the email.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
## As I want to compare 2 numbers I need convert my field values to integers #set ($score1 = $math.toInteger(${lead.Apple_Score})) #set ($score2 = $math.toInteger(${lead.Banana_Score})) ##check if the lead score is greater than feature score #if($score1 >= $score2) ##if Apple score is greater #set($Interest = "Special offer on Apples") ##check is the feature score is higher #elseif($score2 >= $score1) ##if Feature score is greater #set($Interest = "Special offer on Bananas") #else ##otherwise #set($Interest = "Special offer on Fruit") #end ##display the Interest as content ${Interest} |
In the above example I’m just personalising text but I could just as easily for example display a different image based on the higher score.