gaxy
![Go test](https://github.com/duyet/gaxy/workflows/Go/badge.svg)
Google Analytics / Google Tag Manager Proxy by Go.
![](https://github.com/duyet/gaxy/raw/v0.1.2-beta.1/.github/screenshot/how-gaxy-works.png)
Development
Start server in local:
go run *.go
Build binary:
go build -o gaxy .
./gaxy
Testing:
go test
Installation
Using Docker
https://github.com/users/duyet/packages/container/package/gaxy
docker run -it -p 3000:3000 \
-e ROUTE_PREFIX=/analytics \
-e GOOGLE_ORIGIN=https://www.google-analytics.com \
ghcr.io/duyet/gaxy:latest
Using Helm
https://github.com/duyet/charts/tree/master/gaxy
helm repo add duyet https://duyet.github.io/charts
helm install google-analytics-proxy duyet/gaxy
Environment variables
The following environment values are provided to customize Gaxy:
ROUTE_PREFIX
: Gaxy proxy prefix (e.g. /analytics
). Default ""
GOOGLE_ORIGIN
: Hostname to Google Analytics. Default https://www.google-analytics.com
INJECT_PARAMS_FROM_REQ_HEADERS
: Convert header fields to request parameters.
PORT
: Gaxy webserver port. Default: 8080
Usage
<!-- Google Analytics -->
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://your-domain/analytics.js'></script>
<!-- End Google Analytics -->
License
MIT