Re: Prefill a non Marketo form with Data from munchkin cookie

Anonymous
Not applicable

Prefill a non Marketo form with Data from munchkin cookie

Here's what I would like to do.  I would appreciate it if anyone has ideas on how to do this.   

If a user fills out a Marketo Form on a Marketo Landing Page, then a munchkin cookie will be created that is associated with that lead in Marketo.

When the user comes to a custom form on my website that is not a marketo form. I would like to do the following
  1. Get the munchkin cookie
  2. Use the SOAP API to find the lead information by using the cookie as a key. 
  3. Prefill the fields on my form with the data from Marketo
Is this possible?  Basically we are creating a single-sign for protected sections of our website.  If the user has been to our site before and shared information with us, we want to make the registration process for this new single sign on as easy as possible.   So we are thinking if we prefill some fields on the registration form this will make things easier.  

Any ideas or links to articles to figure out how this will work will be appreciated.

Thanks,
Tom
Tags (1)
10 REPLIES 10
Edward_Masson
Level 10

Re: Prefill a non Marketo form with Data from munchkin cookie

This is all possible. But will require lot of work.
This will help you:
https://community.marketo.com/MarketoArticle?id=kA050000000Kyr7CAC
Grégoire_Miche2
Level 10

Re: Prefill a non Marketo form with Data from munchkin cookie

Hi Ed,

The link won't work.

-Greg

Anonymous
Not applicable

Re: Prefill a non Marketo form with Data from munchkin cookie

Does this mean that I use the

hash('sha1',
                           'my-secret-key!' . 'person@company.com')

as the cookie key to retrieve the lead?     I'm planning on retrieving the lead information by using the SOAP API getLead function.  I'm trying to figure out how to get the leadKey->Keytype 
COOKIE: The value generated by the Munchkin Javascript. (e.g. id:561-HYG-937&token:_mch-marketo.com-1258067434006-50277)

Thanks!
Anonymous
Not applicable

Re: Prefill a non Marketo form with Data from munchkin cookie

Thomas, did you ever figure out an approach for this?  I too manage my web forms locally in my Drupal website, and pass submissions over to Marketo using Munchkin.  I also would like to pre-fill these unassociated web forms with values from the cookie.  Care to share where you ended your voyage on this?

Anonymous
Not applicable

Re: Prefill a non Marketo form with Data from munchkin cookie

I am sorry. I never worked this out. I got side tracked by other projects.

SanfordWhiteman
Level 10 - Community Moderator

Re: Prefill a non Marketo form with Data from munchkin cookie

DJ, I don't think you're passing form data using Munchkin... Munchkin primarily tracks page views and clicks.

There are no values stored in the Munchkin cookie. This is a common misperception.  The Munchkin cookie associates your browser activities with a new or preexisting lead. The Munchkin API associateLead method can be used to update fields on the associated lead (blind update, meaning Munchkin can't read the current value first) but there is no Munchkin method for reading fields directly from the lead.  Note that the only way to use the Munchkin API to update fields is to generate a secret per-user hash on your server.  If you you're not doing this, then you aren't using the Munchkin update API.

If your goal is to pull previously posted lead fields into subsequent page views, you have a couple of options.  Easiest is to store those fields in a custom browser cookie or in LocalStorage, where they can be easily read later.  Much more difficult is to securely and reliably read data from the Marketo database into your page.  You'll need to hire a developer to implement this.

Anonymous
Not applicable

Re: Prefill a non Marketo form with Data from munchkin cookie

Is something like this possible in the reverse scenario? Meaning, I have a non-marketo form on a non-marketo landing page. If someone fills this out, I want to be able to pre-populate information in a marketo form on a marketo landing page.

In essence (I think), can Marketo read a third party cookie to pre-fill data in a Marketo form?
Anonymous
Not applicable

Re: Prefill a non Marketo form with Data from munchkin cookie

I need to do the same thing, any suggestions?

SanfordWhiteman
Level 10 - Community Moderator

Re: Prefill a non Marketo form with Data from munchkin cookie

It's not a third-party cookie if it's set for the domain in the browser's location bar (or a parent domain).  That's actually a first-party cookie.

Anyway, the answer is certainly yes.  As long as the cookies share the same domain, then the Marketo form can be set to prefill hidden fields right from the cookie data.  This is actually built-in functionality in the Forms 2.0 Editor: when you add a hidden field, you can tell it to read from data stored in a cookie. The expected use is to pass lead source info from page to page, but you can use it for anything.

If you want to reveal the hidden field after it gets populated from the cookie, you can use a technique like this.