Re: Getting the value of the cookie through the getLead SOAP API?

Anonymous
Not applicable

Getting the value of the cookie through the getLead SOAP API?

Hello,
 
Let me explain my use case first. We use marketo primarily for tracking the user activity on our website. We have embedded the Munchkin JS snippet on all our web pages. AFAIK, the Munchkin snippet creates a unique token, which it stores in the form of a cookie named _mkto_trk, for every new user session. It then logs the user activity against this unique token to marketo. Now, when the new user signs up for an account in our site, we update the lead object created by the JS snippet with his email using the syncLead SOAP API. So far, so good. 
 
But, next time when the same user logs in using the account he created earlier, we want to be able to set the cookie to the old value. So that, the subsequent user activity gets logged to the same lead object instead of a different one. In order to accomplish this, we need to retrieve the cookie value, which was set during the sign up step, using just his email through the getLead SOAP API. But, I could see that the getLead call doesn't give the cookie value in the response. 
 
Are there any additional parameters to be passed to the getLead call to get the cookie value? Or am I doing this completely wrong?

Thanks
Tags (1)
6 REPLIES 6
Jep_Castelein2
Level 10

Re: Getting the value of the cookie through the getLead SOAP API?

The _mtko_trk cookie stays the same across session, so I don't think there is a need to do what you're trying to do. 

However, if you do want to retrieve the _mkto_trk value from Marketo via the SOAP API, you will have to store it in a custom field, in addition to making the association (so you pass it in twice in the same SOAP request, once as a parameter, once as a custom field value). 
Anonymous
Not applicable

Re: Getting the value of the cookie through the getLead SOAP API?

I see what you are saying. Our target audience are predominantly application developers who have a history of clearing their cookies. In which case, we will end up creating multiple leads for the same user. This could mess up our analytics. Also, we want to be able to track users across browsers and devices.

I agree that putting it as a custom attribute should work. So atleast we have a way out here. But, is there a concrete reason why you are not putting the cookie value in the response? Do you guys plan to support it in the future?
Jep_Castelein2
Level 10

Re: Getting the value of the cookie through the getLead SOAP API?

Why do you think you'll end up creating multiple leads? If they submit the same email address, it should append the same record. 
Anonymous
Not applicable

Re: Getting the value of the cookie through the getLead SOAP API?

Ok. So, if the user comes back after clearing his cookies, a new token will be generated. When he logs in, we will have to update his lead object with the new token. As per what you said, I would imagine that the token will get appended to the existing list of tokens? Will the old token would still be valid? What if the user accesses our website from a different browser, yet another token would be generated in this case. Would all these tokens, map to the same lead object?

I would expect it to be valid and the getLead call with any of these tokens, should give me the same lead object.
Jep_Castelein2
Level 10

Re: Getting the value of the cookie through the getLead SOAP API?

Yes, it should update the same Lead reocrd, and each Lead record can have 0 or more cookie IDs/tokens and multiple tokens are valid (although in the case of clearing cookies, it would not be used again; however, it does support people using multiple browsers and/or computers).
Anonymous
Not applicable

Re: Getting the value of the cookie through the getLead SOAP API?

Great. Thats what I wanted to hear. Thanks!!