Skip to content
Browse files

update readme

  • Loading branch information...
giuem committed Feb 14, 2019
1 parent 47a6d31 commit 83e5a994ef007eaedaa99fc714db5f8a8ba864ea
Showing with 19 additions and 40 deletions.
  1. +18 −39
  2. +1 −1 docker-compose.yml
@@ -1,31 +1,21 @@
# ga-proxy

[![Docker Build Statu](](
[![Travis Status](](
[![Docker Build Status](](
[![GitHub release](](

Accelerate Google Analytics

Accelerate Google Analytics.

## Get Start

### Run with Docker
### Run via Docker

docker pull giuem/ga-proxy
docker run -d -p <port>:80 --name <container_name> giuem/ga-proxy

### Run with Docker Compoese

vi `docker-compose.yml`, set port range (Defalut is `9080-9180`).

Then start containers, specify the number of instances.

``` bash
docker-compose up -d --scale proxy=NUM

### Run as you like

#### 1. Install
@@ -35,42 +25,31 @@ Download binary from [release]( or bu
#### 2. Run

./ga_proxy [arguments]
GIN_MODE=release ./ga-proxy [arguments]


-d, -debug output debug info.
-s, -skip_ssl skip ssl verify. (some envirinment don't have certificate)
-l, -listen listen address, default is :80
--ip IP, -i IP IP to listen (default: "") [$IP]
--port port, -p port port to listen (default: "9080") [$PORT]


./ga_proxy -s -l :4000

The program will run at and skip SSL verify

#### 3. Add Script to your website

See [script](js/script.js).

Here is compression version.

!function(a,b,c,d,e){var f=c.screen,g=encodeURIComponent,h=["ga="+a,"dt="+g(d.title),"dr="+g(d.referrer),"ul="+(e.language||e.browserLanguage||e.userLanguage),"sd="+f.colorDepth+"-bit","sr="+f.width+"x"+f.height,"vp="+Math.max(d.documentElement.clientWidth,c.innerWidth||0)+"x"+Math.max(d.documentElement.clientHeight,c.innerHeight||0),"z="];c.__ga_img=new Image,c.__ga_img.src=b+"?"+h.join("&")}("UA-xxxx-x","",window,document,navigator,location);
./ga_proxy -i -p 80

You need to change `UA-xxxx-x` and `` to your own.

Or simple usage, just change `UA-xxxx-x`, and use my service (not fast outside of China)
### 3. Insert script to your website

## Build

gox -os="!freebsd !netbsd !openbsd" -ldflags="-s -w" -output="build/{{.Dir}}_{{.OS}}_{{.Arch}}"
``` html
// replace following variables to your own
window.ga_tid = "UA-XXXXX-Y";
window.ga_url = "";
<script src="" async></script>

Note: `` is my own service, it do not promise any SLA and may shutdown at some day. You'd better deploy your own server.
@@ -4,5 +4,5 @@ services:
image: giuem/ga-proxy
restart: always
- 9080-9180:80
- 9080:80

0 comments on commit 83e5a99

Please sign in to comment.
You can’t perform that action at this time.