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

Zach_Batastini1
Level 2

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

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?)

3 REPLIES 3
Avtar_Singh1
Level 2

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

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

SanfordWhiteman
Level 10 - Community Moderator

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

[Denial of Service attack intensifies]

The REST API is not a suitable substitute for Marketo forms. This has been covered many, many times here.

SanfordWhiteman
Level 10 - Community Moderator

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

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.