Skip to main content
July 8, 2014
Question

Munchkin postWait example?

  • July 8, 2014
  • 4 replies
  • 909 views
Using Munchkin, could I get an example of the 'postWait' attribute being used?  I'm not sure what the syntax would look like or what actual calls it's used for.

This is in regards to the documetation here: 
http://developers.marketo.com/documentation/websites/lead-tracking-munchkin-js/
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

4 replies

July 8, 2014
The syntax you would use is:  "postWait ms 200;"
 
I would try something like this:
 
<script src="http://munchkin.marketo.net/munchkin.js" type="text/javascript"></script> 
<script> 
 mktoMunchkin("###-###-###"); 
 postWait ms 200;
 mktoMunchkinFunction('function', 
 { key: 'value', key2: 'value'}, 
 'hash'); 
</script>
 
If you posted your current Munchkin code and what you are trying to achieve, then I could help you debug. 
July 8, 2014
You could also use the setTimeout() JavaScript method to do the same thing. 
July 9, 2014
Thanks, what I'm trying to achieve is associate a new lead and capturing the click event of the registration button for that lead in successive steps.

Here's the javascript code:

    marketoUpdate = function (parameters, adminID, userID, key) {
        var marketoParameters = {
            Email: parameters.email
            // rest of parameters omitted for space
        };
 
        Munchkin.munchkinFunction('associateLead', marketoParameters, key);
 
        Munchkin.munchkinFunction('clickLink', {
            href: 'sign-up-submission?type=FT',
            Email: parameters.email
        });
    };

'associateLead' works fine on its own, but if I call 'clickLink' after it the lead doesn't even get created.  However if I pause the program before clickLink and resume it manually with considerable delay everything works (the lead gets created and the click event is recorded in their activiy log).

I don't think there's a response for associateLead I can use for a callback to call clickLink?  Any other suggestions are welcome!  
July 19, 2014
Hi John,
The beta version of munchkin tries a little harder to successfully complete calls before moving away from the page. You can try using that.
just switch the URL in your munchkin embed code.

instead of
//munchkin.marketo.net/munchkin.js

use
//munchkin.marketo.net/munchkin-beta.js

If that still does not solve your problems I think you should add your vote to this Idea https://community.marketo.com/MarketoIdeaDetail?id=08750000000HzjkAAC

regards,
DJ