Marketo And WordPress Page Speed - JS, admin-ajax.php | Community
Skip to main content
May 4, 2018
Solved

Marketo And WordPress Page Speed - JS, admin-ajax.php

  • May 4, 2018
  • 1 reply
  • 4898 views

Hi all,

I'm wondering if anyone has any insight on limiting the affect that Marketo's JS scripts have on site speed.

Currently a large chunk of the time our page takes to load is caused by files called from Marketo servers, as well as the following:

POST admin-ajax.php

action=get_marketo_profile&_mkto_trk=id%[our site's ID]
&queryFields=FirstName%2CLastName%2CEmail%2CState

Which, to my understanding, is caused by Marketo attempting to pre-fill a form located on our homepage. I tried disabling auto-fill on the homepage form and this POST admin-ajax.php slowdown still persisted.

So... in addition to the specific questions above, I'm just wondering in general - does anyone have tips for using Marketo on a WordPress site and still having a fast load time?

Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

That hit to your admin-ajax.php isn't Marketo trying to load anything.

You're not only using the regular Marketo form embed -- you also have a 3rd-party WP plugin that is attempting to call the Marketo REST API for every hit. Such plugins are never a good idea, for reasons of both security/reliability and performance.

From a performance standpoint, there's no way such a request could be guaranteed to complete in less than the sum of (roundtrip to your PHP box + roundtrip to Marketo identity endpoint + roundtrip to Marketo lead lookup endpoint). That "unprimed" set of transactions could easily take a few seconds and there's nothing you can do about it. The API just isn't meant to be called in this way. Even if cached information is sometimes usable, it can't be guaranteed so you have to expect the unprimed baseline.

From a security/reliability standpoint, things are even worse. Such plugins allow a malicious person with zero technical skills to consume all of your API calls in a matter of minutes, bringing down your other API-based integrations as well as this feature. Capping the number of API calls that can be used by this particular client app at least protects your other integrations -- but makes this one even easier to bring down.

You might look at this post for tips on accelerating embedded form loads: https://blog.teknkl.com/smoothing-embedded-marketo-form-loads/

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
May 4, 2018

That hit to your admin-ajax.php isn't Marketo trying to load anything.

You're not only using the regular Marketo form embed -- you also have a 3rd-party WP plugin that is attempting to call the Marketo REST API for every hit. Such plugins are never a good idea, for reasons of both security/reliability and performance.

From a performance standpoint, there's no way such a request could be guaranteed to complete in less than the sum of (roundtrip to your PHP box + roundtrip to Marketo identity endpoint + roundtrip to Marketo lead lookup endpoint). That "unprimed" set of transactions could easily take a few seconds and there's nothing you can do about it. The API just isn't meant to be called in this way. Even if cached information is sometimes usable, it can't be guaranteed so you have to expect the unprimed baseline.

From a security/reliability standpoint, things are even worse. Such plugins allow a malicious person with zero technical skills to consume all of your API calls in a matter of minutes, bringing down your other API-based integrations as well as this feature. Capping the number of API calls that can be used by this particular client app at least protects your other integrations -- but makes this one even easier to bring down.

You might look at this post for tips on accelerating embedded form loads: https://blog.teknkl.com/smoothing-embedded-marketo-form-loads/

May 7, 2018

Thank you so much! Very new to Marketo and it's amazing to get such a detailed response on my first post.

If you or anyone else has any quick tips on how to locate the specific plugin that is calling the API, it'd be much appreciated! I'm just digging into a new site that was built on a custom WP theme so it's still quite new to me. If not I'm sure I'll find it - worst case scenario by disabling each plugin one by one.

Thanks again!

SanfordWhiteman
New Participant
May 7, 2018

It would be something with the word "Marketo" in it.

There's no need for a plugin to load Marketo form embeds, so if there's any Marketo plugin at all it's surely the one also trying to use the API.