We've implemented Munchkin in one of our products however every single click on the page translates to a synchronous request to marketo. This means that if Marketo is ever slow to respond, there is a noticeable delay/freeze as the main thread waits for a response from Marketo. Chrome also warns about this:
munchkin.js:10 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
Solved! Go to Solution.
Yes, this is a documented Munchkin.init() option:
Munchkin.init( 'AAA-BBB-CCC', { asyncOnly: true } );
You should be aware that this will drastically (almost comically) decrease accuracy. This is by definition, as an async request is not guaranteed to finish before the page is unloaded and all outstanding foreground connections canceled. Even though Munchkin only requires the HTTP request to complete (the cross-domain HTTP response can't even be processed), the cost of starting up the connection will frequently stop the request from completing.
Yes, this is a documented Munchkin.init() option:
Munchkin.init( 'AAA-BBB-CCC', { asyncOnly: true } );
You should be aware that this will drastically (almost comically) decrease accuracy. This is by definition, as an async request is not guaranteed to finish before the page is unloaded and all outstanding foreground connections canceled. Even though Munchkin only requires the HTTP request to complete (the cross-domain HTTP response can't even be processed), the cost of starting up the connection will frequently stop the request from completing.