Does anyone know why Google Analytics requires two separate script tags?
Specifically, their instructions advise users to embed the following snippet of code into a web
tags are executed in sequence. A
block cannot execute if the previous one isn't done executing.
The first tag is in charge of creating the Google
tag which will load the external js. After the first
is finished executing, the DOM looks like the following:
This guarantees that the second tag will not execute until the
.js
is done loading. If the first and second would be combined, this would cause the
_gat
variable to be undefined (since the Google injected script will not start loading until the first script is done executing).