17 ms·
If you have jQuery on your website alongside Google Analytics, you’re loading two jQuery libraries without you knowing due to Google using it too on their analy
by PhilDunphy23 7y ago
If you have jQuery on your website alongside Google Analytics, you’re loading two jQuery libraries without you knowing due to Google using it too on their analytics script.
- joshstrange 7y agoDo you have a source on this? I can't believe this is true and my 2-3 google searches say it's not.
- PhilDunphy23 7y agohttps://www.googletagmanager.com/gtag/js https://www.googletagmanager.com/gtag/js Search “jQuery” in there, first result will be the copyright comment plus the version.
- localhostdotdev 7y agoit doesn't export to the global namespace though: <script src="https://www.googletagmanager.com/gtag/js"></script> <script>$</script> ReferenceError: $ is not defined <script>jQuery</script> ReferenceError: jQuery is not defined
- joshstrange 7y agoIs that the same JS used for Analytics? I think that's just for GTM. Here is the analytics script I see more often and it doesn't have jQuery: https://www.google-analytics.com/analytics.js https://www.google-analytics.com/analytics.js
- PhilDunphy23 7y agoIt’s the new snippet for analytics.