11 Replies Latest reply on Jul 20, 2018 10:59 AM by Eric Salalmon

    Auto Fill Embedded Forms (not on Marketo landing page)

    Eric Salalmon

      This is a fun one. I have tried to use auto fill forms in the past and it worked, but that was because I was not embedding the form on the web site.

       

      Environment

      Right now I am working with a WordPress site, and have discovered that my predecessor really mucked it up. There were 3 outdated Marketo Plug-ins, the wrong Munchkin code and lots of additional things that brought the site performance down. On top of that all the forms were Iframed. The site also has lots of mixed content HTTP, and HTTPS, right now we are working to move to HTTPS which has issues with the Iframes, because the Marketo instance is not secured with the SSL certificate. (There is an additional cost to adding the certificate in Marketo and there is a small amount of down time.)

       

      Embedding the forms is the solution I came up with, but they don't auto fill. This isn't a deal breaker, but I would like to make things easier for people when they fill out forms.

       

      Research

      I have been putting together some information based on the scripts and other sources I noticed:

      http://developers.marketo.com/rest-api/assets/forms/examples/

      http://developers.marketo.com/javascript-api/forms/

      Auto populate form from Marketo cookie and auto submitting the form

      http://developers.marketo.com/blog/external-page-prefill/

       

      The concept looks secure, but the instructions for implementing them are not. Writing the JS I could probably figure out, but how would one connect the REST API to the website to pull the field data?

       

      <script src="//app-ab14.marketo.com/js/forms2/js/forms2.min.js"></script>

      <form id="formID"></form>

      <script>

        MktoForms2.loadForm("Link", "Marketo Stuff", Form#,function(form) {

        var prefillFields = {

        "Email" : mktoLeadFields.email,

        "FirstName" : mktoLeadFields.firstName,

        "LastName" : mktoLeadFields.lastName,

        "Company" : mktoLeadFields.company

        };

        }

        );

      </script>

       

      This is where I got in the coding setup any additional advise would be great.

       

      Message was edited by: Eric Salaman