Re: Caching for Lead Database REST API?

BCMCarreiro
Level 1

Caching for Lead Database REST API?

Hello,

After creating a new Lead via a Lead Form, how long should I expect to wait until the response from the Lead Database API gets updated with the new Lead?

Thank you,

-Michael

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Caching for Lead Database REST API?

There's no fixed delay. The form submission is asynchronous, could take a few seconds or maybe even a minute under load. Can you explain exactly what you're trying to do? We need to know there's not an XY Problem.

BCMCarreiro
Level 1

Re: Caching for Lead Database REST API?

We have lead forms on our site, however, we only want to display a lead form is a user hasn't filled one our before (at least by making our best guess at it.)

 

We follow this documentation to call the Get Multiple Leads By Filter Type REST endpoint and check if any Leads have been submitted with the token saved in the _mkto_trk cookie:

https://developers.marketo.com/blog/get-a-visitors-cookie-id-and-then-query-associated-lead-data/

 

If we don't find the cookie value in this Lead database, then we display the form. However, if we do find it, then we hide the form because we know they are already being tracked.

 

We've received some feedback that some viewers are continuing to see lead forms for up to 20 minutes after submission. I haven't reproduced this myself, though I have reproduced up to a 5 minute delay between submitting a form and seeing my Lead/cookie token reflected in the JSON response.

 

I'm curious if Marketo documents any expected time for this API response to update with the latest submissions so that we could also set expectations for our own audience?

Thanks,

-Michael

SanfordWhiteman
Level 10 - Community Moderator

Re: Caching for Lead Database REST API?

That’s a convoluted approach that also opens you to a simple DoS attack.

 

Marketo Forms support Known Visitor HTML (“If known visitor, show custom HTML” in Form Editor). You can use this to suppress future forms if the cookie is already associated. There’s no need to guess or use the API, simply enable KV HTML.

BCMCarreiro
Level 1

Re: Caching for Lead Database REST API?

Hi Sanford,

The solution we're building is to work for a variety of MAPs for our customers to integrate into Video Players which they publish to their site. The integration into the Marketo API works through a backend proxy that we use to validate whether or not the user is known so that we can make our best guess as to whether or not our Video Player should display the lead form. We are not directly communicating to your API from the client.

 

I am just learning of this KV HTML feature, do you have a link to any documentation on it or where I can find it within the Marketo UI? I am interested in learning more about it and testing how it works with our existing form setup.

 

However, as we currently load lead forms into a Customer's UI based on whether or not a Lead is a Known Visitor from the API is our current setup that we have been using for years with Marketo, I would like to get some kind of answer on my original question as to how long we should expect to wait between lead form submission and a cache refresh on the Leads Database API Response.

 

Thank you,

-Michael

SanfordWhiteman
Level 10 - Community Moderator

Re: Caching for Lead Database REST API?


The solution we're building is to work for a variety of MAPs for our customers to integrate into Video Players which they publish to their site. The integration into the Marketo API works through a backend proxy that we use to validate whether or not the user is known...


I hope you don’t mean you’re also doing a Marketo API lookup by cookie in real-time (itself a DoS vector)?

 


We are not directly communicating to your API from the client.

Of course not, that would be much worse than the DoS vulnerability and is actually impossible due to CORS.

 


I am just learning of this KV HTML feature, do you have a link to any documentation on it or where I can find it within the Marketo UI? I am interested in learning more about it and testing how it works with our existing form setup.

It’s a prominent feature of Forms 2.0.

 


However, as we currently load lead forms into a Customer's UI based on whether or not a Lead is a Known Visitor from the API is our current setup that we have been using for years with Marketo, I would like to get some kind of answer on my original question as to how long we should expect to wait between lead form submission and a cache refresh on the Leads Database API Response.

There simply is no SLA for form submissions.