gaxy

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2020 License: MIT Imports: 11 Imported by: 0

README

gaxy

Docker Go test

Google Analytics / Google Tag Manager Proxy by Go.

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL