leek
GA tracking
Last updated 11 years ago by twokul .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install leek 
SYNC missed versions from official npm registry.

Leek

Build Status

Initial implementation was based on Insight.

Track Events:

var Leek = require('./lib/leek'),
    leek = new Leek({
      trackingCode: 'xx-xxxxxxxx-x',
      globalName:   'my-nifty-package',
      version:      '1.0.1'
    });

leek.trackEvent({
  name:     'my-nifty-package',
  category: 'pony show',
  label:    'white',
  value:    'jumps'
});

Track Errors:

var Leek = require('./lib/leek'),
    leek = new Leek({
      trackingCode: 'xx-xxxxxxxx-x',
      name:         'my-nifty-package',
      version:      '1.0.1'
    });

try {
  throw new Error('ZOMG FIX ME')
} catch(e) {
  leek.trackError({
    description: e.message + ' ' + e.stack,
    isFatal: true
  });
}

Track command hits:

var Leek = require('./lib/leek'),
    leek = new Leek({
      trackingCode: 'xx-xxxxxxxx-x',
      name:         'my-nifty-package',
      version:      '1.0.1'
    });

leek.track({
  name:    'my-nifty-package show pony',
  message: 'pony is here'
});

Disable Tracking:

Environment Variable

Setting the DISABLE_LEEK environment variable will disable tracking.

Alternative Tracking Endpoints

Passing in an object of adapter URLs will send the data to alternative tracking service.

var Leek = require('./lib/leek');
var leek = new Leek({
  trackingCode: 'xx-xxxxxxxx-x',
  name:         'my-nifty-package',
  version:      '1.0.1',
  adapterUrls: {
    appview: 'http://example.com/collect-app',
    exception: 'http://example.com/collect-exception',
    timing: 'http://example.com/collect-timing',
    event: 'http://example.com/collect-event'
  }
});

Constructor Options

var Leek = require('./lib/leek');
var leek = new Leek({
  trackingCode: 'xx-xxxxxxxx-x',
  name:         'my-nifty-package',
  version:      '1.0.1',
  silent:       true
});

GA Setup

You are now able to set up alternative tracking services but to set up GA follow these steps:

  • Set your new property up as a Mobile App
  • Add the Tracking ID in your leek initialisation as seen above.
  • To add the NodeJS as well as OS Version tracking go to the Admin -> Custom Definitions -> Custom Metrics
  • Add a new Custom Dimenstion with the Name OS and Scope Session
  • Add a second Custom Dimenstion with the Name Node Version and Scope Session as well
  • Make sure they are both active and you have everything you need to get the tracking running properly

Current Tags

  • 0.0.24                                ...           latest (8 years ago)

24 Versions

  • 0.0.24                                ...           8 years ago
  • 0.0.23                                ...           8 years ago
  • 0.0.22                                ...           8 years ago
  • 0.0.21                                ...           9 years ago
  • 0.0.20                                ...           9 years ago
  • 0.0.19                                ...           9 years ago
  • 0.0.18                                ...           10 years ago
  • 0.0.17                                ...           10 years ago
  • 0.0.16                                ...           10 years ago
  • 0.0.15                                ...           10 years ago
  • 0.0.14                                ...           10 years ago
  • 0.0.13                                ...           10 years ago
  • 0.0.12                                ...           10 years ago
  • 0.0.11                                ...           10 years ago
  • 0.0.10                                ...           10 years ago
  • 0.0.9                                ...           10 years ago
  • 0.0.8                                ...           10 years ago
  • 0.0.7                                ...           10 years ago
  • 0.0.6                                ...           10 years ago
  • 0.0.5                                ...           11 years ago
  • 0.0.4                                ...           11 years ago
  • 0.0.3                                ...           11 years ago
  • 0.0.2                                ...           11 years ago
  • 0.0.1                                ...           11 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (5)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE