This article is about Universal Analytics. If you are using the next generation of Google Analytics, refer to the Google Analytics 4 properties section of this help center.

Hosting the JavaScript file locally

Avoid referencing local versions of analytics.js and ga.js.

While it's possible to download the JavaScript file (gtag.js) to examine it, storing or serving the JavaScript file locally is not recommended.

Referencing the JavaScript file from Google's servers (i.e., https://www.googletagmanager.com/gtag/js) ensures that you get access to new features and product updates as they become available, giving you the most accurate data in your reports.

Was this helpful?
How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
69256
false