I have the same question.
There's no builtin hitCallback as there is with GA. My "Munchkin Enhanced" adapter adds this capability into Munchkin. But can I ask what you're using it for? There may be another way.
Thanks for your reply Sanford. I was hoping for a callback after the Munchkin cookie is set, so I may send the cookie to another domain. I assumed Munchkin wouldn't call visitWebPage until that cookie had been finalized, so I was first probing for one there. Then I later discovered a function called Munchkin.createTrackingCookie but couldn't find any documentation on this, certainly none with any mention of a callback, so then attempted to bind a callback of my own to that but ran out of time figuring out the art of doing that in JS. So I ended up setting an interval to check for the cookie after the munchkin script is requested. That seems to work fine, just not as elegant.
No need for an interval. Cookies are always set synchronously, immediately after the Munchkin library (not the bootstrapper) loads.
So:
Munchkin.init('AAA-BBB-CCC');
document.addEventListener('load', function(e) {
if (/\/munchkin.js$/.test(e.target.src)) {
setTimeout(function() {
// cookie must exist here on this turn of the event loop
});
document.removeEventListener('load',arguments.callee,true);
}
}, true);
Very creative and elegant approach!
Thank you so much, I'm going to try this.
Yeah, I am quite proud of it.