SOLVED

Re: Different landing pages based on how many times Leads fill out form

Go to solution
Anonymous
Not applicable

Different landing pages based on how many times Leads fill out form

Hi all,

Here is a quick explanation of what I'm trying to accomplish:

I want Leads to fill out a form on our website in order to win a prize. If it's their first time filling out the form, I want them to be redirected to a thank you landing page. If they fill out the same form a second time, I want them to be redirected to another landing page that says they have already entered the contest.

My question is, is there a way to follow-up with a different landing page based on how many times a person has filled out a form? Thanks in advance!

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Different landing pages based on how many times Leads fill out form

It's simple to do this at a good-faith level.


1. Add a score field, in this example Form Fillout Count, to the form as a Hidden field.

2. Add this little bit of Forms 2.0 JS:

MktoForms2.whenReady(function(form){

  var currentValues = form.getValues();

  form.setValues({

    fillCount : parseInt(currentValues.fillCount) + 1 || 1

  });

});

3. Then you can Add Choice on the Thank You page:

pastedImage_3.png

Now, this isn't a Price Waterhouse-grade secure sweepstakes. A malicious user with mild technical skills can easily tweak their score back to 0. But then again, that same user would probably just sign up with another email alias and/or clear their cookies.

If it isn't clear, the difference between incrementing the score on the client side and bumping it in a Smart Campaign is doing it on the form itself ensures the new value will be available at the time the Thank You Page is decided. On the flipside, it also means you can't stop a person with minor skillz from changing the way the form works. But chances are you aren't validating sufficiently on the back end (very few Marketo users do) for this to be a substantive issue.

View solution in original post

4 REPLIES 4
Darrell_Alfons2
Level 10 - Champion Alumni

Re: Different landing pages based on how many times Leads fill out form

Hey Bruna,

I'm not sure of how to do this. But if no one else knows, I thought maybe you could do it via confirmation email.

So they will always hit a thank you page that says "confirmation has been sent" and they get that in their inbox.

But if they have already filled out the form they get a different email saying they have already entered the contest.

SanfordWhiteman
Level 10 - Community Moderator

Re: Different landing pages based on how many times Leads fill out form

It's simple to do this at a good-faith level.


1. Add a score field, in this example Form Fillout Count, to the form as a Hidden field.

2. Add this little bit of Forms 2.0 JS:

MktoForms2.whenReady(function(form){

  var currentValues = form.getValues();

  form.setValues({

    fillCount : parseInt(currentValues.fillCount) + 1 || 1

  });

});

3. Then you can Add Choice on the Thank You page:

pastedImage_3.png

Now, this isn't a Price Waterhouse-grade secure sweepstakes. A malicious user with mild technical skills can easily tweak their score back to 0. But then again, that same user would probably just sign up with another email alias and/or clear their cookies.

If it isn't clear, the difference between incrementing the score on the client side and bumping it in a Smart Campaign is doing it on the form itself ensures the new value will be available at the time the Thank You Page is decided. On the flipside, it also means you can't stop a person with minor skillz from changing the way the form works. But chances are you aren't validating sufficiently on the back end (very few Marketo users do) for this to be a substantive issue.

Anonymous
Not applicable

Re: Different landing pages based on how many times Leads fill out form

Thank you so much for the answers guys! Sanford Whiteman, I'm interested in trying your approach, but I've never had to insert JS into a form before. Could you walk me through it? I tried right-clicking the form and choosing Embed Code but I not able to edit the script.

SanfordWhiteman
Level 10 - Community Moderator

Re: Different landing pages based on how many times Leads fill out form

Right, you can't change the embed code.

You'd wrap the code above in <script></script> tags and insert it directly after the embed code.

On a Marketo-hosted LP (where the embed code is not used) make sure the <script> is after the line that loads the Forms 2.0 library (forms2.min.js) which is automatically inserted by Marketo. Easiest way to do this is to add it right before the closing </body> tag.