Need help with cloudflare-workers-async-google-analytics?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

SukkaW
157 Stars 30 Forks MIT License 20 Commits 1 Opened issues

Description

:cloud: The Cloudflare Workers implementation of an async Google Analytics

Services available

!
?

Need anything else?

Contributors list

# 4,195
JavaScr...
hexo
lodash
hugo
18 commits
# 121,451
plugin-...
C
C++
non-roo...
1 commit
# 35,391
Shell
netease
ncm
vuejs
1 commit

cloudflare-workers-async-google-analytics

Author Sukka License MIT NPM Version Build with Cloudflare Workers Gzip size of cfga.min.js

The Cloudflare Workers implementation of an async Google Analytics

Introduction

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.

Get Start

1. Import into Cloudflare Workers

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.

2. Insert the
cfga.min.js
into your website

Just add those few lines of the code to your website, right before

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.