When you load JavaScript from a third party, you shouldn't put it directly in your code! There exists a whole eco-system of providers that allow you to manage this now, called "Tag Management Systems"
I develop one of these (that is free to signup and use until you get to 1M PVs per month - opentag.qubitproducts.com).
OpenTag and most TMS-es have many advantages of putting specifc vendor code on your website.
* Only one line on each page - don't need to worry about bloating your home page. By doing this you get a nice separation of concerns between actual functional code and 3rd party code.
* Code can come from a tested library of vendor approved script templates - we have ovr 100 and are constantly growing.
* By using "universal variables" which telling the scripts specific values in a well-defined manner, you can easily configure scripts up. For example on a purchase confirmation page, you may have several scripts that fire off to remarketing, affilliate and analytics providers. By setting these variables up once, you can easily plug-in new variables when your marketing team requests it.
* You can tell scripts to only fire on certain scenarios - only on certain pages, or only when a visit came from a certain referrer or not when they come to a landing page with a specific utm parameter.
* Asyncs your document.write code at the click of a checkbox (or automatically if it is from the library)