We are trying to redirect new leads who submit a certain webform to 3 different URL's based on their new lead score. This score is determined by the values they chose in the fields they enter on the form. Is it possible for Marketo to score leads fast enough to be able to accomplish this?
If not, can we accomplish this with Javascript?
You can't use a scoring program on the server side to do this, but it's easy to do in JS on the client.
What do your rules look like? Different scores for different options in a dropdown and such? Lay out the ruleset and I'll describe how to code it.
Hey Sanford,
Thanks for helping out! This is our Ruleset Sheet.
The field score column is what we are using as the lead score value in Marketo.
Let me know if this doesn't make sense.
We are only concerned with "Quality Score" in for the redirect.
Cool, what are the "tiers, that is, score ranges corresponding to each URL? What I'd like to do is forward that final tier to the back end (along with the actual score) so you can still use Add Choice to set the Thank You URL (alternately, we could forward to the TY URL all in JS, but that exposes all 3 URLs if someone's inspecting the source, so why not hide it if we can?).
I think I'd like to use this case in a blog post, as it is (pleasantly) complex. I'll anonymize the data, of course, but the general idea is cool enough for one, don't you think?
Yes, Absolutely!
Right now we actually would just like to have these 2 "tier" URL redirects (in the future we would like to branch out to more):
Lead Score = -300-50 -> Medium Office Box Subscription
Lead Score = 51+ -> Claim Your Free Sample Box - Thank You | SnackNation
If possible, we'd like to make it simple to change the code ourselves as we adjust the scoring model and add more score redirect options.
In addition (if not too complex), we'd like to pass the email field through in the URL to the "TY" page.
In addition (if not too complex), we'd like to pass the email field through in the URL to the "TY" page.
OK, that's easy, but as it's a separate task I won't put that in the main demo:
form.onSuccess(function(vals,tyURL){
document.location.href = tyURL + '?Email=' + encodeURIComponent(vals.Email);
return false;
});
I'd do it as demoed here:
MktoForms2 :: Form Scoring Tiers
The only part of the Forms 2.0 API JS you'd have to touch is the config block here:
/* set up score-related fields */
var scoringConfig = {
scoreFields: {
raw: "formScore",
tier: "formScoreTier"
},
scoreElements: [{
name: "NumberOfEmployees",
multiplier: 10
}, {
name: "pw_cc__CurrentGenerators__c",
multiplier: 20
}],
scoreTiers: [{
name: "A",
min: -300,
max: 50
}, {
name: "B",
min: 51,
max: Infinity
}]
};
As may be self-explanatory, the scoreFields both must exist in your Marketo instance and are added as hidden fields on the form. One holds the raw numeric score from the form, the other is the (string) tier value that's located via JS (and which you would use with Add Choice in the Form Editor to determine the Thank You URL).
The multiplier is what you're calling "weight" -- for general use I think multiplier is more clear.
You manage the scores for each option right in Form Editor. Add them at the end of the display value in square brackets:
The score is parsed and removed when the form is loaded, so leads don't ever see the score.