• Stars
    star
    2,922
  • Rank 15,515 (Top 0.4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 14 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Real time web analytics using node.js and web sockets

HUMMINGBIRD

Site tracking and analytics storage

Description

Hummingbird serves a 1x1 tracking pixel to users. In the browser's GET request it sends back tracking data generated by javascript.

Requirements

  • node.js v0.8.0 or higher

Installation

git clone git://github.com/mnutt/hummingbird.git
cd hummingbird

# Use npm to install the dependencies
npm install

# To use the map, download MaxMind's GeoIP database and extract to the root directory:
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
gunzip GeoLiteCity.dat.gz

Running Hummingbird

To start the analytics server, run the following:

node server.js

By default a dashboard will be run on port 8080. You can disable it for production use in config/config.js. The dashboard is just html served out of public/; you can serve it using any webserver.

Deployment

Make sure to properly secure the dashboard if you don't want outside people to see it. This typically means putting the dashboard behind nginx or apache using basic auth. The dashboard's 'listen' function takes a second argument that is the interface to bind; typically you would choose "127.0.0.1" to only allow access from localhost, or "0.0.0.0" to listen on all interfaces. You should then run the tracking pixel on a different port so that it is accessible to the outside world.

Setting Up Tracking

The file client/hummingbird.js contains a small script to trigger a hummingbird event. You can either paste the contents of the file into the body of your webpage or you can upload it to your server as a .js file and reference it with a <script> tag. Once you have done so, in the footer of your page you can call

HummingbirdTracker.track();

Called with no arguments, it will send over some standard parameters such as the page URL. You can also pass arbitrary data with the event:

HummingbirdTracker.track({logged_in: true});

The data can be used within Hummingbird's metrics to filter events on the backend.

Architecture Overview

Hummingbird is organized into two parts: a node.js-based tracking server that records user activity via a tracking pixel, and a collection of javascript-based widgets that display that activity. The server broadcasts all activity to the clients using Websockets if possible, and falls back to Flash sockets or long polling if necessary.

The Hummingbird.WebSocket object receives websocket events from the server in the form of JSON objects. Individual widgets subscribe to a metric and register handler functions to be called whenever that metric is present.

Logging Customization

Metrics are stored in lib/metrics and auto-loaded. Each metric contains a handler function that is called every time a new user event occurs. Metrics store data in the data object property which gets emitted to clients in intervals specified by the metric. A basic example can be found in lib/metrics/total_views.js. An example of how a metric can filter based on query params is in lib/metric/cart_adds.js.

Display Customization

Hummingbird comes with some stock widgets (Counter, Logger, Graph) that demonstrate how to hook into the data provided by the node.js server. For the minimum amount required to create a widget, see public/js/widgets/logger.js. A widget is an object whose prototype extends Hummingbird.Base and implements onMessage.

Tips

Contributors

  • Michael Nutt [email protected]
  • Benny Wong [email protected]
  • mikecampo
  • caphrim007
  • brianjriddle
  • lbosque
  • robertjwhitney
  • Dan Thurman
  • thinkroth
  • markwillis82
  • ochronus
  • dannyakakong
  • xinbenlv

License

Hummingbird is licensed under the MIT License. (See LICENSE)

More Repositories

1

davros

Personal file storage server
JavaScript
292
star
2

hid.im

hid(e your torrent files in) im(ages)
Ruby
44
star
3

libqxt

mirror of libqxt on bitbucket
C++
41
star
4

redis-pubsub-to-websockets

Connect a Redis PubSub channel to a websockets channel using Node.js
JavaScript
33
star
5

octo.cat

URL shortener for Github on mobile
Ruby
24
star
6

hid.im-firefox

Firefox extension to convert an image to a torrent
JavaScript
20
star
7

limecast

A directory of video podcasts
HTML
12
star
8

rpodcast

A ruby library that helps with fetching and parsing podcast rss feeds.
Ruby
11
star
9

canvas-waves

Drawing waves (ocean, not google) with canvas
11
star
10

cluster-responsetimes

Response time stats for cluster.js
JavaScript
10
star
11

hydraproject

The Hydra Project
Ruby
9
star
12

limewire5-ruby

Ruby experiments in LimeWire5
Java
9
star
13

NYC-Subway-Map

Attempt at a NYC subway map modeled in git.
8
star
14

khepri

Process Manager GUI
JavaScript
8
star
15

funnel_cake

Sales funnel tracking and visualization plugin for Rails
JavaScript
8
star
16

intranet

Tools for your company's intranet
Ruby
7
star
17

node-router-benchmarks

Benchmarking different Node.js routers
JavaScript
6
star
18

limewire-remote

Rails-based remote control for limewire
JavaScript
6
star
19

gilded_age

Safari/Chrome Extension for gilt.com
JavaScript
5
star
20

acts_as_state_machine

acts_as_state_machine
Ruby
5
star
21

action_assets_helper

Put action-specific javascript and stylesheet link tags in the views, and render them in application.html.erb
Ruby
4
star
22

resque-publisher

Publishes to redis pubsub on job enqueue, start, finish, and failure
Ruby
4
star
23

restaurant_map

Mapping favorite restaurants
JavaScript
4
star
24

ember-cli-vagrant-spk

Develop Ember-based Sandstorm applications using vagrant-spk
JavaScript
3
star
25

emacs-starter-kit

fork of topfunky's emacs-starter-kit
Emacs Lisp
3
star
26

camera-server

Remote control a DLSR or other camera via gphoto2 (ptp)
JavaScript
3
star
27

gilt-colors

JavaScript
3
star
28

jslint-multi

Faster jslint checking
Ruby
3
star
29

group-tabs-by-domain

Firefox Extension that works with Tree Style Tab
JavaScript
3
star
30

resque-livemonitor

Bringing websockets to resque-web
Ruby
3
star
31

inboxsig

An unread count for your email signature
JavaScript
3
star
32

prototype-portal

A javascript-based portal page, with rearrangable widgets. Cloned from http://blog.xilinus.com/2007/8/26/prototype-portal-class.
JavaScript
3
star
33

torrentizer

torrentizer
Ruby
2
star
34

limeplayer

LimeWire + Titanium
JavaScript
2
star
35

limespot

Limespot
2
star
36

mongo-rails-instrumentation

Records time taken in mongo, and add result to Rails request log
Ruby
2
star
37

redact-rack

Redact words from your ******* rack app
Ruby
2
star
38

nyc_stations

Rails app pre-loaded with NYC subway stations, lines, etc
Ruby
2
star
39

mnutt.github.com

website
JavaScript
2
star
40

partial_map

Rails plugin that provides a rake task to view the heirarchy of views and partials they render
Ruby
2
star
41

quick_git_help

Create tutorials from commits to a git repo
Ruby
1
star
42

qt-phantom-platform-plugin

Qt qpa plugin for running headless apps, with font support (extracted from phantomjs)
C++
1
star
43

webrat-colorized

Colorize the html error output for failed matchers
Ruby
1
star
44

rtracker

A lightweight ruby tracker app
Ruby
1
star
45

sideloader

Hashes web urls to create torrents
Ruby
1
star
46

soundmachine

SoundManager-based Wordpress plugin for a customizable mp3 player
JavaScript
1
star
47

jogdial

Remember those $40 Griffin usb jog dials from 2000? Now you can turn your $600 iPad into one.
Ruby
1
star
48

apptourguide

See the sights.
Ruby
1
star
49

movable_feast

JavaScript
1
star
50

html5

Git mirror of html5 gem
Ruby
1
star
51

zipdown

Firefox extension to navigate zip archives directly from download manager
JavaScript
1
star
52

nodescape

Cubescape multiplayer deathmatch
JavaScript
1
star
53

color_picker

Shop by color...
JavaScript
1
star
54

scorecard

Cocoa app to display output of rspec
JavaScript
1
star
55

mylimewire

...
Ruby
1
star
56

boxcar-command-line

VERY simple Boxcar command-line client
1
star
57

libreoffice-sandstorm-test

Cap'n Proto
1
star
58

nailedem

Nailed Em is a thumbnailing service built with sinatra
Ruby
1
star