Why do websites like Hotjar and Google Analytics use complex tracking code instead of just a <script> tag?
Website that use JS tracking usually use this kind of code : <script> (function(h,o,t,j,a,r){ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; h._hjSettings={hjid:9999,hjsv:5}; a=o.getElementsByTagName('head')[0]; r=o.createElement('script');r.async=1; r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; a.appendChild(r); })(window,document,'//static.hotjar.com/c/hotjar-','.js?sv='); </script> In the end, those scripts just add a <script> tag to the <head> of the page, so surely there must be a reason why they're doing it this way. Is it for ad-blocking bypass reasons ? Wouldn't the