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:
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:
Here is what actually happened:
What is the problem, and how to fix?
Thanks ~
What does your hash function look like?
Which hash function are you referring to? If you are talkin about the "$('#first').val()" ... that is standard jquery code.
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.
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.
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.