{"id":13734846,"url":"https://github.com/boynet/cf-GoogleAnalytics-shield-worker","last_synced_at":"2025-05-08T11:31:10.603Z","repository":{"id":71019115,"uuid":"191321283","full_name":"boynet/cf-GoogleAnalytics-shield-worker","owner":"boynet","description":"simple cloudflare worker to protect google analytics from being blocked by ad blockers","archived":false,"fork":false,"pushed_at":"2020-03-04T12:38:27.000Z","size":4,"stargazers_count":32,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-03T03:04:05.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boynet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-11T07:50:22.000Z","updated_at":"2024-08-03T03:04:06.158Z","dependencies_parsed_at":"2023-03-13T20:22:19.643Z","dependency_job_id":null,"html_url":"https://github.com/boynet/cf-GoogleAnalytics-shield-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boynet%2Fcf-GoogleAnalytics-shield-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boynet%2Fcf-GoogleAnalytics-shield-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boynet%2Fcf-GoogleAnalytics-shield-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boynet%2Fcf-GoogleAnalytics-shield-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boynet","download_url":"https://codeload.github.com/boynet/cf-GoogleAnalytics-shield-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224727120,"owners_count":17359530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T03:01:00.477Z","updated_at":"2024-11-15T03:31:11.484Z","avatar_url":"https://github.com/boynet.png","language":"JavaScript","funding_links":[],"categories":["Msc"],"sub_categories":[],"readme":"# Google Analytics shield - Cloudflare worker\nsimple cloudflare worker to protect google analytics from being blocked by ad blockers(it can be anywhere around 5 to 30 percent of the users)\n\n\nIt works by proxy the google analytics script file and endpoint url.\n\nright now it support only the `analytics.js` tracking and the `https://www.google-analytics.com/*collect` endpoint\nthere is other urls which not proxied right now(which will get blocked), in my case I dont need them, like:\n* ampcid.google.com\n* stats.g.doubleclick.net\n\n## How to install:\n* change UrlPrefix and EndPointScramble Parameters to random string, a common ads\\analytics related words will get blocked\n* make your worker route to url matches `http://example.com/UrlPrefix*`\n* change your site google analytics script from `https://www.google-analytics.com/analytics.js` to `/UrlPrefix.js`\n* (change UrlPrefix to the value you used in the worker parameter)\n\n## Warnings:\n* pay attention to the gdpr law\n* if you have millions of requests I am  not 100% sure its good idea to use it as google can rate limit the cloudflare worker ips, as the ips are shared between all cloudflare accounts so its good idea to reconsider it\\ask google about it\n* make sure to rescramble the urls from time to time\n\n### todo:\n- [ ] log failed requests\n- [ ] proxy all the urls needed for analytics(?)\n- [ ] support the new gtag.js script\n- [ ] auto scrambled the endpoint from time to time\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboynet%2Fcf-GoogleAnalytics-shield-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboynet%2Fcf-GoogleAnalytics-shield-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboynet%2Fcf-GoogleAnalytics-shield-worker/lists"}