Munchkin associateLead didn't update user

Anonymous
Not applicable

Munchkin associateLead didn't update user

I have an external form that I tie to Marketo through Munchkin code as below:

Munchkin.init('xxx-xxx-xxx');

Munchkin.munchkinFunction('visitWebPage', {url: '/r/2016-thank-you', params: 'registration=1'});

Munchkin.munchkinFunction('associateLead', {FirstName: '"' + $('#first').val() +'"', LastName: '"' + $('#last').val() +'"', Email: '"' + $('#email').val() +'"' }, data.token);

In addition, I have a smart campaign doing the following:

  • on page view "/r/2016-thank-you"
    • add user to list
    • send user email confirmation

Here is the Problem

An existing cookied user in marketo e.g. "fred@gmail.com" filled out an external form (first, last, email). He used a different email "jdoe@gmail.com" (along with a different name: john, doe) while filling out the form. Instead of the following happening:

  1. The user info: first, last, email gets updated
  2. That updated info gets added to list
  3. That updated email receives the confirmation email

Here is what actually happened:

  1. The user info: first, last, email was NOT updated
  2. The original info gets added to the list
  3. The original email receives the confirmation email

What is the problem, and how to fix?

Thanks ~

5 REPLIES 5
Marketo Employee

Re: Munchkin associateLead didn't update user

What does your hash function look like?

Anonymous
Not applicable

Re: Munchkin associateLead didn't update user

Which hash function are you referring to? If you are talkin about the "$('#first').val()" ... that is standard jquery code.

Marketo Employee

Re: Munchkin associateLead didn't update user

I'm asking what you're using the generate the value for data.token.  It could be mismatched between the two email addresses, causing the call to fail.

Anonymous
Not applicable

Re: Munchkin associateLead didn't update user

Definitely not because the smart campaign runs as mentioned above (i.e. add to list, send confirmation email). The only issue is that the data didnt change for the existing marketo user.

I just thought, what if the issue is that the "if view page" happens first (it does), it would trigger the "add list" and "send email". This makes sense; however, the info should still change at the end.

I will try to put the view page after the associatelead. What are your thoughts here.

Level 10 - Community Moderator

Re: Munchkin associateLead didn't update user

associateLead is synchronous, so putting it first will give you better -- but not entirely bug-free -- results.  At least you will know that the HTTP request completed, though you will not know that the back-end association has actually completed. I believe there's still an essential race condition here in that (as you pointed out) attributing the action to the new lead is not guaranteed to happen before the trigger fires on the action.