We use custom forms on non-Marketo pages which then submit to Marketo in the background. This works great and gives us lots of flexibility especially with A/B tests. The team now would like a pre-fill feature for all users. The idea is that if the visitor is known, we should pre-fill the form with their info (name, email, company, e.t.c.). This applies to all types of visitors.
Previously, I've looked into using _mkto_trk as described in this article: https://developers.marketo.com/blog/external-page-prefill/. In a nutshell, I'd be checking for the existence of that cookie on page load before Munchkin loads and sets a new cookie for the anonymous visit. If it exists, then that would indicate that the user has been cookied in the past. Then I'd go ahead hit the leads db to retrieve the known users info (if known) via Marketo's REST API. In doing this, I'd at least cut down the number of requests made per visit since it'd only happen when the user has been cookied prior to the current visit.
Question is, is the above plan reasonable? What are other options for pre-filling forms? How else do you identify users (name, email, phone, e.t.c.) ? I'm happy to explore custom options like storing session data in localStorage and looking that up in subsequent visits.
Thank you internet in Marketoverse.
Solved! Go to Solution.
The blog post is well written and clearly explains what the code does. I do see what you mean though, lots of moving pieces!
Thank you for sharing. This is certainly a better approach than making random POST requests. First time seeing this method though
setValuesCoerced, it's not in the API docs (but it's in the source code).