3 Replies Latest reply on Feb 13, 2019 1:54 PM by Sanford Whiteman

    Marketo Forms (non landing page) Load Times / Wordpress Ninja Forms

    Zachary Batastini

      We are trying to optimize our website load time and consistently see that the longest "wait" for a page to load is due to the marketo form embed script. Testing various plugins for our wordpress based site to help with the caching, preload, cdn, etc... every time JS minification is enabled the marketo forms quit functioning properly. With all that being said can someone please help guide in the best direction:

       

      - We have 80+ marketo forms that either delivery datasheets, whitepapers, or webinars on demand after form submit. I have explored trying to go a more global form route but with the variety of collateral gated by a marketo form this doesn't seem to be a good option.

      - I really like the Ninja Forms plugin for wordpress, have successfully set up the webhook to post data to a marketo form BUT when trying to follow guides for associating a lead with a cookie/session to get the page visits and such, nothing appears to work.

       

      - Is there a downside or reason to not take the marketo JS and host it on my webserver and change the source for the script on the marketo form embed code? This would help with the pre-fetch and response time for the marketo forms (i would think?)

        • Re: Marketo Forms (non landing page) Load Times / Wordpress Ninja Forms
          Avtar Singh

          Hi Zachary Batastini,

           

          It is not a good option to keep Marketo JS on your server. It may result in non-rendering of the Marketo form. Moreover In some cases, If you keep Marketo JS on your server then that JS can again send a request to Marketo.com to load Form JS. Hence there would be two unnecessary JS request.

           

          You can use Ninja form and on form submission, a lead can be created into the Marketo using REST API. After creating lead through API you need to call associatead API call to track visit webpage activity.

           

          Best Regards,

          Avtar Singh

          • Re: Marketo Forms (non landing page) Load Times / Wordpress Ninja Forms
            Sanford Whiteman

            You should read this post: https://blog.teknkl.com/smoothing-embedded-marketo-form-loads/

             

            You cannot successfully load the Forms 2.0 library from your own server, because it's not just the JS library but supporting polyfill and style assets that need to load as well.  You can redirect all of that through your CDN to in order to extend the caching period, if you think that would be useful.

             

            Note one of the reasons forms incur network latency is that the form descriptor is reloaded from the origin every time -- that's why, if you make a change in the Form Editor UI, it's reflected immediately on your page. If you're willing to do manual cache invalidation instead, you can embed the descriptor object in a static script block, right on the page. No fetch required.

             

            - I really like the Ninja Forms plugin for wordpress, have successfully set up the webhook to post data to a marketo form BUT when trying to follow guides for associating a lead with a cookie/session to get the page visits and such, nothing appears to work.

            This plugin creates a DoS vulnerability against all your integrations (including itself). If you want to use non-Marketo forms, post from the client using the Forms 2.0 JS API. You can load the form embed code asynchronously in this case, as the form rendering doesn't depend on it.