Hey Marketo Community! Question: In the webform builder, when using Advanced Thank You Page logic, is there a way to have 2 fields to both simultaneously need specific criteria in order for a specific Thank You Page to appear?
Theoretical example: Right now my webform logic dictates "If Product Interest = Product A, send them to Thank You Page A"
I want the logic to say "If Product Interest = Product A, AND Company Size > 1000, send them to Thank You Page B"
Is something like this doable? Thank you very much!
Solved! Go to Solution.
No need to re-fetch the values, though. They’re already in the first argument.
MktoForms2.whenReady(function (form) {
form.onSuccess(function(submittedValues, followUpUrl) {
if (submittedValues.ProductInterest == "Product A" && submittedValues.CompanySize > 1000 ) {
location.href = "https://www.example.com";
} else {
location.href = "https://<your default-thank you page>";
}
return false;
}
});
});
Also technically you should copy the aliId value from the original followUpUrl to the custom Thank You URL.
You can use Mktoforms 2.0 onSuccess handler to handle such cases. You can more conditions using if else if else as well. Ideally, you'd want to add this script right before the closing body tag (</body>).
MktoForms2.whenReady(function (form) {
form.onSuccess(function(values, followUpUrl) {
var vals = form.vals();
if (vals.ProductInterest == "Product A" && vals.CompanySize > 1000 )
location.href = "https://www.example.com";
else
location.href = "https://<your default-thank you page>";
return false;
});
});
No need to re-fetch the values, though. They’re already in the first argument.
MktoForms2.whenReady(function (form) {
form.onSuccess(function(submittedValues, followUpUrl) {
if (submittedValues.ProductInterest == "Product A" && submittedValues.CompanySize > 1000 ) {
location.href = "https://www.example.com";
} else {
location.href = "https://<your default-thank you page>";
}
return false;
}
});
});
Also technically you should copy the aliId value from the original followUpUrl to the custom Thank You URL.
Got it, thanks so much for the help Sanford! Also thank you in general for pretty much being the Batman of the Marketo community, saving the day left and right
You’re welcome!