17 Replies Latest reply on Jun 21, 2018 10:12 PM by Sanford Whiteman

    Form not pre-filling reliably

    Kai Crow

      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)

        • Re: Form not pre-filling reliably
          Sanford Whiteman

          Yes, this is expected behavior. As I responded to someone else earlier today, there is no guarantee that the session cookie will be associated by the next pageview. While association typically only takes a couple of seconds at most, it happens asynchronously not interlocked in any way with the next HTTP request.

           

          Marketo LPs can also read values from a read-your-write cache, designated by the aliId query parameter, instead of from the cookie-associated lead. The aliId would normally would take care of your concerns here, but you're stripping it out on /demo-request-2.html with this piece of code:

           

             $(document).ready( function() {
                url = "https://get.asknicely.com/demo-booking.html";
                $( location ).attr("href", url);
             });
          

           

          (Also, $(location).attr("href",<url>) isn't really the way to do this, it's location.href = <url> -- and no, those aren't the same!)

           

          I don't know why you're waiting until .ready (DOMContentLoaded) on the interstitial, but assuming that part is truly necessary, you want this:

           

             $(document).ready( function() {
                var redirectLoc= document.createElement("a");
                redirectLoc.href = "https://get.asknicely.com/demo-booking.html";
                redirectLoc.search = document.location.search;
                document.location = redirectLoc;
             });
          
          • Re: Form not pre-filling reliably
            Sanford Whiteman

            You should also read this post related to the same feature: https://blog.teknkl.com/dont-call-a-marketo-lp-an-external-url/

              • Re: Form not pre-filling reliably
                Kai Crow

                So if I'm understanding correctly, then my first setup should have worked fine - form 1 had the follow-up (yes, I wish they'd be consistent with naming) action set to a marketo landing page (the one that lives at https://get.asknicely.com/demo-booking.html ). Am I understanding correctly that then the built in behaviour of the marketo landing page should be if the association hasn't been completed, then load the data from the aliId parameter? Or would I need to separately setup a fall-back method to use the aliId data?