Munchkin is not associating anonymous activity with Leads on login | Community
Skip to main content
August 11, 2014
Solved

Munchkin is not associating anonymous activity with Leads on login

  • August 11, 2014
  • 17 replies
  • 3702 views
As I understand it, I'm supposed to be able to make Munchkin associate anonymous lead activity with an existing Lead when they log in.  That's not working for me.

On my post-login page, I'm calling this:

<script type="text/javascript">
$.ajax({
  url: '//munchkin.marketo.net/munchkin.js',
  dataType: 'script',
  cache: true,
  success: function() {
    Munchkin.init('xxx-xxx-xxx', {"wsInfo":"xxxxxxxxxxxxx"});
    Munchkin.munchkinFunction('associateLead',
      { email: 'some@email' }, 'long_sha1_hex');
  }
});
</script>

The long_sha1_hex is computed in Ruby via:
  Digest::SHA1.hexdigest( encrypt_key + email_address )

I'm not getting any error mesages in my js console, and no feedback that anytying is wrong.  But that munchkinFunction appears to be having zero effect.

Can anyone help me out?
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
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.

17 replies

August 12, 2014
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?
 
August 12, 2014
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
August 13, 2014
Aaaaaaargh.

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

Thanks.
August 13, 2014
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.
August 20, 2014
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
Accepted solution
September 11, 2014
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.
September 11, 2014
Great catch, Grant! Thanks for sharing that with everyone.