beacon

command module
v0.0.0-...-0a319f2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2015 License: MIT Imports: 15 Imported by: 0

README

beacon

Circle CI

A tiny subset of Google Analytics, in Go.

Beacon provides the familiar 1x1 transparent PNG web tracking image, but on your own servers and domain, and with a simple API. Data is stored in Redis using HyperLogLog for uniques. It is very fast, easily handling hundreds of concurrent requests on a free Heroku instance. See the Blitz.IO report.

Deploy to Heroku

API
var objectID = "post_" + 1234;
var image = new Image(1,1);
var url = "//beacon.herokuapp.com/" + objectID + ".png";
image.src = url;

See the results at https://beacon.herokuapp.com/api/v1/post_1234, which supports CORS.

{
  "visits": 14,
  "uniques": 4
}

You can migrate your existing visits and uniques from another platform by POSTing JSON to the Beacon API.

Demo

There is an invisible image above this line, though GitHub's Markdown proxies and anonymizes everything. The real URL is https://beacon.herokuapp.com/beacon_github_repo.png.

See the traffic we've tracked so far here: https://beacon.herokuapp.com/api/v1/beacon_github_repo

Thanks

This app uses the smallest possible 1x1 transparent PNG, thanks to the awesome work by Gareth Rees.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/codegangsta/negroni
Package negroni is an idiomatic approach to web middleware in Go.
Package negroni is an idiomatic approach to web middleware in Go.
_workspace/src/github.com/dchest/uniuri
Package uniuri generates random strings good for use in URIs to identify unique objects.
Package uniuri generates random strings good for use in URIs to identify unique objects.
_workspace/src/github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package gorilla/mux implements a request router and dispatcher.
Package gorilla/mux implements a request router and dispatcher.
_workspace/src/github.com/mholt/binding
Package binding deserializes data from HTTP requests into a struct ready for your application to use (without reflection).
Package binding deserializes data from HTTP requests into a struct ready for your application to use (without reflection).
_workspace/src/github.com/phyber/negroni-gzip/gzip
Package gzip implements a gzip compression handler middleware for Negroni.
Package gzip implements a gzip compression handler middleware for Negroni.
_workspace/src/github.com/rs/cors
Package cors is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/ You can configure it by passing an option struct to cors.New: c := cors.New(cors.Options{ AllowedOrigins: []string{"foo.com"}, AllowedMethods: []string{"GET", "POST", "DELETE"}, AllowCredentials: true, }) Then insert the handler in the chain: handler = c.Handler(handler) See Options documentation for more options.
Package cors is net/http handler to handle CORS related requests as defined by http://www.w3.org/TR/cors/ You can configure it by passing an option struct to cors.New: c := cors.New(cors.Options{ AllowedOrigins: []string{"foo.com"}, AllowedMethods: []string{"GET", "POST", "DELETE"}, AllowCredentials: true, }) Then insert the handler in the chain: handler = c.Handler(handler) See Options documentation for more options.

Jump to

Keyboard shortcuts

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