Sync Anonymous user data to lead | Community
Skip to main content
October 7, 2014
Solved

Sync Anonymous user data to lead

  • October 7, 2014
  • 6 replies
  • 1726 views
i'm having an issue our custom forms properly syncing anonymous data after someone has become a lead. I have tried both the munchkin API with associate lead (per this link: http://developers.marketo.com/blog/merge-anonymous-visitor-activity-when-visitor-fills-out-form/ ), as well as the standard implementation of the SOAP API call syncLead (which, as i understand it, will do the same job...). im not sure what im missing. 

here is a link to both of the implementations:
  • Marketo Munchkin: pastebin.com/Rzck1yxn
  • syncLead: pastebin.com/7Pm6hDdN
Any help would be great...Thanks!
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kenny_Elkington
Hi Matt,

I see one issue in each of the examples you provided.  First, the associateLead call, you're setting th Email field to an empty string, so even in the call submits to your marketo instance, it can't associate the anonymous cookie into a known lead record.

EDIT: You're probably setting this dynamically in the server so this is probably a different issue.

Second, with your syncLead call, I don't see a marketoCookie parameter.  in the XML, the leadRecord needs a marketoCookie submitted after the leadAttributeList in order to perform a known-anonymous lead association.  Unless this is already a part of your LeadRecord class I don't see a way that this would work.

6 replies

Kenny_Elkington
Adobe Employee
Kenny_ElkingtonAdobe EmployeeAccepted solution
Adobe Employee
October 7, 2014
Hi Matt,

I see one issue in each of the examples you provided.  First, the associateLead call, you're setting th Email field to an empty string, so even in the call submits to your marketo instance, it can't associate the anonymous cookie into a known lead record.

EDIT: You're probably setting this dynamically in the server so this is probably a different issue.

Second, with your syncLead call, I don't see a marketoCookie parameter.  in the XML, the leadRecord needs a marketoCookie submitted after the leadAttributeList in order to perform a known-anonymous lead association.  Unless this is already a part of your LeadRecord class I don't see a way that this would work.
October 7, 2014
yea, the munchkin email field is being set via php (i guess i grabbed the interpreted source from the browser, instead of the actual file)

and what you are saying with the syncLead is that i need to add the optional parameter of marketoCookie like so? 
public function syncLead($key, $marketoCookie, $attrs) {
...
}

id prefer to use syncLead instead of the munchkin API whenever possible.
Kenny_Elkington
Adobe Employee
Adobe Employee
October 7, 2014
That's right, Matt.  marketoCookie is the final attribute in the leadRecord as defined in the wsdl: http://developers.marketo.com/documentation/soap/synclead/  You'll need to pass the captured cookie value like this

$leadRec->marketoCookie = $marketoCookie;

Once you're passing this the association will be made between the cookied anonymous record and the known record indicated by your key.

I'd also add, I highly recommend logging your calls.  In case you need help from Marketo Support determining what's wrong with your calls, they'll require the XML call and respose to assist.
October 7, 2014
Thank you!

i will try that and report back. 
October 7, 2014
it looks like that worked! im having my team test now, but my preliminary tests show that anonymous lead data is now syncing!

thank you!!
Kenny_Elkington
Adobe Employee
Adobe Employee
October 7, 2014
Happy to help, Matt.  Cheers.