Skip to content

erkiesken/amplitude

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amplitude

Server side implimentation of Amplitude's http api.

Install

npm install amplitude --save

Initialization

var Amplitude = require('amplitude');
// Initialize with user id
var amplitude = new Amplitude('api-token', { user_id: 'some-user-id' });
// Or initialize with device id
var amplitude = new Amplitude('api-token', { device_id: 'some-device-id' });

Track an event

Pass in any keys listed on the Amplitude http api. The only required key is event_type.

var data = {
  event_type: "some value", // required
  event_properties: { 
    //... 
  },
  user_properties: { 
    //... 
  }
}
amplitude.track(data);

Track an event with an optional callback

amplitude.track(data, function(error) {
  // If post was succesful, error will be null
  //... do something
});

About

A node wrapper for Amplitude analytics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%