Behold, the Event Tracker
Usage:
var tracker = new EventTracker({
key: 'MyApp01',
secret: 'abcdef==',
postData: jQuery.post,
calculateHash: createHmac,
endpoint: 'https://events-test.redditmedia.com/v1',
clientName: 'desktopWeb',
appendClientContext: true,
bufferTimeout: 100,
bufferLength: 40,
debug: true,
);
tracker.track('mod_events', 'ban', {
user_name: 'allthefoxes',
user_id: 't2_8aioi',
sr_name: 'noadmins',
sr_id: 't5_2xakt',
details_text: 'reason: being an admin',
target_id: 't2_3bzrh',
target_name: 'ajacksified',
target_type: 'user',
}, defaults);
tracker.send(callback);
Testing
Using It
- Either use it as a git-linked NPM package, copypaste it into your project, or
git-submodule it.