Mobile app version of vmapp.org
Login or Join
Dunderdale272

: Legal Issues of loading Google Analytics script (ga.js) from local server to avoid leverage browser catching issue Anywhere that I check my website I get a leverage browser catching issue because

@Dunderdale272

Posted in: #GoogleAnalytics

Anywhere that I check my website I get a leverage browser catching issue because of this file:
www.google-analytics.com/ga.js

In many questions and answers, articles people have offered to get the source of the script and serve it from my own server. Doing this is very easy but my concern is, If I do this, is there anything legal I should be concerned about?

Does google approve of doing this?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Dunderdale272

2 Comments

Sorted by latest first Latest Oldest Best

 

@RJPawlick198

I think that the most important point is that creating a local copy of that file is totally counterproductive. The reason is very simple. The file comes in two versions (ga.js and the older analytics.js) and can be served over 2 protocols (HTTP and HTTPS). This means that the browser only ever needs to keep at most 4 cache entries, irrespective of the number of sites using Google Analytics that the user visits. These cache entries can be refreshed with HTTP requests that don't require to download the content (unless of course the content has changed).

Since so many sites use GA it is very unlikely that the browser needs to download the file when a user visits your site (because it either has an up to date version of the file or it just needs to send a small request to confirm that the file hasn't changed). In that case, using a local copy would actually increase the average latency of the first page view for your site.

10% popularity Vote Up Vote Down


 

@Courtney195

Approve? Well, they don't recommend it.

The major downside of this is updates. If they update, you don't get it because you downloaded.
This can result in broken of faulty statistics.
support.google.com/analytics/answer/1032389?hl=en

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme