Skip to main content
August 19, 2015
Question

Searching leads by cookie yields nothing

  • August 19, 2015
  • 1 reply
  • 1851 views

I have a web page with form that submits data to Marketo (user name and email.) Later, when I am trying to retrieve lead information using cookie that has been created for that page via API, I get nothing; however searching for emails and names input from that for via lead database UI shows that they've been saved, and if I use lead id from UI in my API instead of cookie, I get the complete info.

Can anyone please tell me where did I go wrong?

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

1 reply

SanfordWhiteman
Level 10
August 19, 2015

Does the web page load Munchkin?  Can you give an example of the Munchkin cookie you're retrieving and searching on?

August 20, 2015

Cookie I am trying to use looks like id:111-ABC-222&token:_mch-sitename.domain-1440077784604-36440

Munchkin is (i hope) loaded with this JS:

$.ajax({

  url: '//munchkin.marketo.net/munchkin.js',

  dataType: 'script',

  cache: true,

  success: function() {

    Munchkin.init('111-ABC-222');

  }

});

August 20, 2015

Hi Egor,

I'm a little confused as to where you are trying to find the record by cookie Id, but I don't think it works from the Lead Database section within Marketo. Also, I'm not sure if you are using the REST or SOAP API. In any case, hopefully this info helps: 

For SOAP:

Are you passing the optional 'marketoCookie' parameter when creating records with your API form?   If not, you may be creating disassociated lead records that won't have page visit history.

syncLead » Marketo Developers

For REST:

I haven't done this in REST so perhaps @Sanford Whiteman can confirm, but you may need 2 API calls.

The first to create a record or update the record:

Create/Update Leads » Marketo Developers

There is another API call to associate a lead record with a cookie id here:

Associate Lead » Marketo Developers

In both cases, the end result should be a newly created lead that also has the anonymous activity.

Hope it helps!