9 ms·
You actually can host the Google Analytics JS file locally, though I'm not sure it's an officially supported configuration.
by eli 11y ago
You actually can host the Google Analytics JS file locally, though I'm not sure it's an officially supported configuration.
- danieltillett 11y agoDo you have any resources on doing this?
- codedokode 11y agoYou could probably proxy a file through your own server and add any headers you like. But in that case browser cannot use a version of a script cached at other sites.
- rgbrenner 11y agoit's definitely not a supported config: https://support.google.com/analytics/answer/1032389?hl=en https://support.google.com/analytics/answer/1032389?hl=en But you can download it, and host it locally. Just update it periodically. As you can see from the changelog, it only changes every few months: https://developers.google.com/analytics/devguides/collection/analyticsjs/changelog?csw=1 https://developers.google.com/analytics/devguides/collection... Google actually takes a few days to deploy updates to all of their servers. So a daily script to update it on your server would be fine.
- danieltillett 11y agoThanks for this.