Mobile app version of vmapp.org
Login or Join
Angie530

: Does placing Google Analytics code in an external file affect statistics? I'm working with an outside software vendor to add Google Analytics code to their web app, so that we can track its

@Angie530

Posted in: #GoogleAnalytics #Javascript #Statistics

I'm working with an outside software vendor to add Google Analytics code to their web app, so that we can track its usage. Their developer suggested that we place the code in an external ".js" file, and he could include that in the layout of his application.

The StackOverflow question "Google Analytics: External .js file covers the technical aspect, so apparently tracking is possible via an external file.

However, I'm not quite satisfied that this won't have negative implications. Does including the tracking code as an external file affect the statistics collected by Google?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Angie530

2 Comments

Sorted by latest first Latest Oldest Best

 

@Shanna517

Why would the location of the code affect the statistics? Whether you make an XHR request using inline JavaScript or a function call to an external library makes no difference to the browser, much less the server your request is directed at.

10% popularity Vote Up Vote Down


 

@Cody1181609

As long as the code runs, Google won't care whether it's in-line or not.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme