Search
Clear search
Close search
Google apps
Main menu

Help us improve Analytics Education. Tell us how you like to learn!

Hosting the JavaScript file locally

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

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

Referencing the JavaScript file from Google's servers (i.e. http://www.google-analytics.com/analytics.js or https://www.google-analytics.com/analytics.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 article helpful?
How can we improve it?
Google Analytics training and support resources

Check out our comprehensive list to learn more about Analytics solutions.