SOLVED

Re: Form pre-fill on Non Marketo pages with background form submission

Go to solution
TonyM
Level 2

Form pre-fill on Non Marketo pages with background form submission

Background

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.

 

Plan

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Form pre-fill on Non Marketo pages with background form submission

There's only one way to do this that doesn't crumble under the slightest pressure (natural or malicious):

https://blog.teknkl.com/pre-fill-any-site-any-form/

Any other method isn't vouchsafeable.

View solution in original post

4 REPLIES 4
SanfordWhiteman
Level 10 - Community Moderator

Re: Form pre-fill on Non Marketo pages with background form submission

There's only one way to do this that doesn't crumble under the slightest pressure (natural or malicious):

https://blog.teknkl.com/pre-fill-any-site-any-form/

Any other method isn't vouchsafeable.

View solution in original post

Jo_Pitts1
Level 9

Re: Form pre-fill on Non Marketo pages with background form submission

@TonyM ,

Follow @SanfordWhiteman 's blog - but be VERY VERY detail focussed.  There are a couple of moving parts that I often don't get quite right though moving to fast!

TonyM
Level 2

Re: Form pre-fill on Non Marketo pages with background form submission

The blog post is well written and clearly explains what the code does. I do see what you mean though, lots of moving pieces!

TonyM
Level 2

Re: Form pre-fill on Non Marketo pages with background form submission

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