Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Post Mortems | 10,270 | 2 months ago | 10 | |||||||
A collection of postmortems. Sorry for the delay in merging PRs! | ||||||||||
Encrypted Dns | 1,976 | 3 months ago | 12 | unlicense | ||||||
DNS over HTTPS config profiles for iOS & macOS | ||||||||||
Gdindex | 1,813 | 3 months ago | 56 | mit | HTML | |||||
A Google Drive Index built with Vue Running on CloudFlare Workers | ||||||||||
Goindex | 1,124 | 7 months ago | 56 | JavaScript | ||||||
Index your Google Drive | ||||||||||
Siteproxy | 754 | a year ago | 30 | mit | JavaScript | |||||
reverse proxy, 反向代理,免翻墙访问Youtube/twitter/Google, 支持telegram web登录。请勿将本项目用于非法用途,否则后果自负。 | ||||||||||
Secureoperator | 238 | 4 | 3 years ago | 16 | January 01, 2019 | 1 | apache-2.0 | Go | ||
A DNS-protocol proxy for DNS-over-HTTPS providers, such as Google and Cloudflare | ||||||||||
Ssdeploy | 195 | 2 months ago | 38 | March 24, 2022 | mit | JavaScript | ||||
Netlify replacement to deploy simple websites with better flexibility, speed and without vendor lock-in | ||||||||||
Cloudflare Workers Async Google Analytics | 149 | 2 years ago | 5 | June 16, 2020 | 1 | mit | JavaScript | |||
:cloud: The Cloudflare Workers implementation of an async Google Analytics | ||||||||||
Searchy | 132 | 2 months ago | 2 | mit | TypeScript | |||||
Cloudflare + Google = supercharged web surfing | ||||||||||
Gargantuan Takeout Rocket | 112 | 24 days ago | 3 | |||||||
🚀 Backup Google Takeout archives (YouTube channel and Google Photos) at 1GB/s+ to Azure Storage periodically with minimal human toil and financial cost |
The Cloudflare Workers implementation of an async Google Analytics
This project is based on Google Analytics Measurement Protocol, using Cloudflare Workers with a less than 1KB gzipped tiny cfga.min.js
to accelerate the Google Analytics, rather than a heavy (45KB gzipped) analytics.js
from Google.
Login into Cloudflare Dashboard and enter Workers
App. Create a new script, delete default code in the editor, and then copy the woker.js
content into the editor. After saving the workers script, do not forget to register a route for the scripts.
Now you can test your workers with a simple HTTP request. You should able to see 403 Forbidden
. Then you can deploy the scripts.
cfga.min.js
into your websiteJust add those few lines of the code to your website, right before </body>
. Do not forget to replace the default configuration with your own!
<script>
window.ga_tid = "UA-XXXXX-Y"; // {String} The trackerID of your site.
window.ga_api = "https://example.com/xxx/"; // {String} The route of your cloudflare workers you just registered before.
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]" async></script>
Releases Only
.Click the watch
button at the top of the repo and choose Releases Only
, so you can get notice of release update in time.
cfga.js
will send the data once the window's load
event is fired.
But you can still manually send the data again by calling window.cfga()
, just like the original analytics.js
with ga('send', 'pageview')
.
Recently cloudflare-workers-async-google-analytics
has been blocked by EasyList. Great Job though. So I am going to play a cat & mouse game now.
From 1.0.3
the random string will be added as a parameter to bypass EasyList. Also, this could help, too:
cfga/jquery.js
for your Cloudflare Workers.window.ga_api = "https://example.com/cfga/jquery.js"; // {String} The route of your cloudflare workers you just registered before.
Block jquery.js
if you can, haha!
cfga.min.js
collected and sentCurrently, cloudflare-workers-async-google-analytics
and cfga.min.js
only support collect those types of data listed below. If you want to collect more, you should use Google Analytics official track code.
dl
: Document location URLuip
: User real IPua
: User Agentdt
: Document Titlede
: Document Encodingdr
: Document Referrerul
: User Languagesd
: Screen Colors Depthsr
: Screen Resolutionplt
: Page Load Timedns
: DNS Timepdt
: Page Downloaad Timerrt
: Redirect Response Timetcp
: TCP Connect Timesrt
: Server Response Timedit
: DOM Interactive Timeclt
: Content Load Timecloudflare-workers-async-google-analytics
blocks those types of request by default:
User-Agent
in request headersReferer
in request headersAnd if you want to restrict your workers only for your website, all you need to do is to edit a few lines of your workers:
//const AllowedReferrer = 'skk.moe';
skk.moe
, then remove //
.Notice: set
AllowedReferrer
value toskk.moe
means all the subdomains ofskk.moe
will be allowed as well.
cloudflare-workers-async-google-analytics © Sukka, Released under the MIT License.
Authored and maintained by Sukka with help from contributors (list).
Personal Website · Blog · GitHub @SukkaW · Telegram Channel @SukkaChannel · Twitter @isukkaw · Keybase @sukka