Form not pre-filling reliably

Kai_Crow2
Level 2

We've just setup a process using two forms to collect data in two parts:

1) collect email address on initial submission via an embedded mkto form on our home page

2) collect a few further details on a mkto landing page with a form (user is directed to the lading page via the success action of the embedded form)

*Most of the time, this works well - they arrive at the form on the landing page with email pre-filled and the other fields needing completion. However, every so often, the email field is not pre-filled. In those cases, if you immediately refresh the page, it is then pre-filled. Seems to me like sometimes the page is loading too quickly and the pre-fill is failing, or something like that? But then I've never seen this happen on another landing page, so wondering if this is something to do with passing between the embedded form and the mkto landing page.

Anyone else noticed a similar issue? Any ideas on a work around?

At the moment I'm thinking the best option is to use a javascript to reload the page once to ensure the pre-fill is completed

Try it yourself if you want:

NPS Software - Real time Customer Feedback | AskNicely

(form is the get a demo one on the first screen)

26 REPLIES 26
Kai_Crow2
Level 2

Thanks again Sanford - I'm going to go ahead and update to pass email via the URL parameter as you suggest. Definitely owe you a beer if I ever happen to make it to Marketing Nation!

I wondered if it might be due to having two embedded forms on the page that the form wasn't behaving as expected, but have tried removing the other embedded form and didn't make any difference.

SanfordWhiteman
Level 10 - Community Moderator

Thanks again Sanford - I'm going to go ahead and update to pass email via the URL parameter as you suggest. Definitely owe you a beer if I ever happen to make it to Marketing Nation!

Sounds good!

It wouldn't be the 2 forms. I think the form must be corrupt (which happens, albeit very rarely) and isn't remembering that you're using a named LP. You should be getting the ​aliId attached automatically.

SanfordWhiteman
Level 10 - Community Moderator

Also, if you only care about the email address you can just pass it in the URL.

On the first page:

MktoForms2.whenReady(function(form){

  form.onSuccess(function(vals,tyUrl){

    var tyLoc = document.createElement("a");

    tyLoc.href = tyUrl;

    tyLoc.hash = encodeURIComponent(vals.Email);

    document.location = tyLoc;

    return false;

  });

});

On the second page:

MktoForms2.whenReady(function(form){
  form.setValues({

    Email : decodeURIComponent(document.location.hash.substring(1))

  });

});

Kai_Crow2
Level 2

That's a tidy solution! Yes, that will work

Kai_Crow2
Level 2

Oh and URL with the new form on is: NPS Software - Real time Customer Feedback | AskNicely

Kai_Crow2
Level 2

Sure - I'll create an alternate version with the original setup if you want to take a look.

Thanks again for your help!