Answer the question
In order to leave comments, you need to log in
What are the main advantages of inline instead of external JavaScript for analytics codes?
Many large sites place analytics codes directly on the page before the closing body tag. The question arose - how is such, at first glance, a lazy way better than the logic of analytics in an external script?
Answer the question
In order to leave comments, you need to log in
It is impossible to block the loading of scripts, for example. You can only disable it on the site itself.
Not all browsers understand async/defer, so a guaranteed way to make the download non-blocking is to trigger it with JS.
most likely it is needed so that it is considered only when the page is loaded , and not just the page was started loading or even a separate
ps script is a good way to access the dom without getting (depending on the speed of loading) errors about not found element
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question