4.0.1 • Published 2 years ago

google-analytics-proxy v4.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
2 years ago

Google Analytics Proxy

Cloudflare Workers script to bypass firewalls and blockers for Google Analytics.

Server

The proxy server is a Cloudflare Workers script.

Develop

npm run develop-server

Build

npm run build-server

Deploy

Deploys to workers.dev

npm run deploy-server

Client

An example client is provided in src/client.

The client uses analytics.js with a custom sendHitTask to send data to the proxy server. The client is also setup to track additional custom dimensions with every hit.

Develop

npm run develop-client

Build

npm run build-client

Publish

The client is published as an npm package. To publish, increase version in package.json then

npm publish

Usage

<script async src="https://proxy.domain/analytics.js"></script>
import analytics from "google-analytics-proxy/client";

analytics.init("UA-147724716-1", "https://proxy.domain/collect");

analytics.ga("send", "pageview");
analytics.ga("send", "event", {
  eventCategory: "Test",
  eventAction: "Click",
  hitCallback: () => {},
});
4.0.1

2 years ago

4.0.0

2 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago