SOLVED

Re: Munchkin is not associating anonymous activity with Leads on login

Go to solution
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Hi Grant,

Munchkin Init and Munchkinfunction can be called sequentially. The init call is synchronous for all the things that munchkinFunction needs.

Most customers have one of the following problems when using associateLead.
  1. The generated hash is incorrect
    • EncryptKey is copied incorrectly
    • Email used is not the same as the lead being associated/updated
    • Hash Function used is not SHA1
    • There are trailing or leading spaces when passing the hash to munchkin.
  2. The browser is being re-directed to another page as soon as associatelead is called. (munchkin does not have enough time to perform the associate Lead which is a asynchronous call)
  3. The Munchkin ID being used and the Encrypt Key are from different subsciption.

I'll proceed with the presumption that you have checked all of the above conditions. 

Since we are receiving other successful associateLead calls to munchkin we have to presume that it is not a pervasive condition. Would it be possible to have either Murtza or me take a look at the actual page that you are trying to do this on?

regards,
Dj

Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Thanks DJ, that's a very helpful comment.
 
It very well could be that I am encrypting it wrong.  (I really wish Munchkin could give some kind of status code feedback if this was the case.)
 
This is how I am encrypting it (using Ruby, though I'm not assuming you know this particular function):
 
    Digest::SHA1.hexdigest( encrypt_key + email_address )
 
And the actual function call in Javascript is:
 
    Munchkin.munchkinFunction('associateLead', {email: 'grant@email.address'}, '<hex from above>');
 
The email address I'm using does correspond with an existing lead.  Do those calls look basically correct?
 
If yes, then it's possible I'm not using the right key.  It's a length-44 hexidecimal string, right?    I'm using the same key that I use for my Marketo SOAP API calls.  Am I perhaps mistaken in assuming that I can/should use the same key for SOAP and Munchkin?
 
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Hi Grant,

I think we may have found your problem :-). The Key for munchkin is set from Marketo Munchkin Admin.
  • Log into Marketo 
  • Go to Admin 
  • Under Integration  click on  Munchkin
  • Enable Munchkin API and set a API key there
You should use this key for Munchkin API functions. 

We are planning to introduce callback functions to Munchkin calls, https://community.marketo.com/MarketoIdeaDetail?id=08750000000HzjkAAC with the next Beta. Stay Tuned. Callbacks would  allow you to ensure delivery of your API call before moving on. This would still not give you a success/Failed satus because that  could allow anybody on the internet to brute force guess your api key/lead details.

Regards,
DJ
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Aaaaaaargh.

I've asked my admin to set up a key for me.

Thanks.
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

My admin has given me a key which is 18 alphanumeric (not hex) characters.  He created this key himself (e.g. contains real words).

Does this sound like a correct key?  I tried it, and it did not work.
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Hi Grant, 

I've taken a look in your instance, and reviewed the currently defined API Private Key.

The currently defined API Private Key does not have full words in it. I've included that key in the case I have open with you. Please check your case notes to find the value of your API Private Key. 

Please use this key and see if this resolves your issue. As stated by DJ, you need to use the key listed in your Marketo Admin section. 

Best regards,
Chris
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Ugh.  See this code?

Munchkin.munchkinFunction('associateLead', {email: 'grant@email.address'}, '<hex from above>');

The "e" in "email" needed to be capitalized.   That's it.

Ugh.
Anonymous
Not applicable

Re: Munchkin is not associating anonymous activity with Leads on login

Great catch, Grant! Thanks for sharing that with everyone.