Asynchronous JQuery and lost analytics | Community
Skip to main content
Jan 25, 2018 11:25 PM UTC
Solved

Asynchronous JQuery and lost analytics

Hi all,

We previous had Asynchronous Munchkin tracking code in the <header> of our site and just a couple days ago I switched it out for Asynchronous JQuery (our site includes JQuery 2.2). We had been seeing sluggish, 2-part loading on Marketo forms embedded on site pages and load time has improved drastically since I swapped in the Asynchronous JQuery Munchkin code. But, when I check in Web Page Activity -> Report we only have one Person for each day since I updated the Munchkin code (compared to dozens the previous days). The entry page is also identical (/render2). I wondered if there was a JQuery version conflict but this thread seems to indicate that this hasn't been an issue for awhile.

I'd appreciate any ideas or instruction!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jan 25, 2018 11:58 PM UTC

When you try to call $.ajax, jQuery (i.e. the global $ object) is not present in the page, since you load it later in the document.

Implemented properly, the asynchronous Munchkin (without jQuery) cannot slow down initial page rendering. jQuery only adds a level of complexity (the jQuery library must be loaded first), it doesn't improve performance.

3 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jan 25, 2018 11:58 PM UTC

When you try to call $.ajax, jQuery (i.e. the global $ object) is not present in the page, since you load it later in the document.

Implemented properly, the asynchronous Munchkin (without jQuery) cannot slow down initial page rendering. jQuery only adds a level of complexity (the jQuery library must be loaded first), it doesn't improve performance.

Translate
Jan 26, 2018 6:35 PM UTC

Thanks Sanford! I should've caught that. Do I lose any Marketo tracking by moving the Munchkin code to above </body>?

Translate
SanfordWhiteman
Level 10
Jan 26, 2018 6:59 PM UTC

If you aren't doing any custom tracking, no.

Translate