Skip to main content

Node JS

Requirements

  • Access permission to your Node.JS website or server code
  • Able to write javascript code to integrate our Node.JS SDK with your system

Use Cases

  • Track user identity, behavior or transaction event from your Node.JS backend server.

Guideline

Installation

npm install --save filum-node-sdk

Usage

As server-side application doesn't have local storage to persist user_id or anonymous_id so you must specify either user_id or anonymous_id in your tracking code.

const Analytics = require('filum-node-sdk');

const client = new Analytics('WRITEKEY');

client.identify({
user_id: '52rrd-242rc-2r2cc-2c09a',
event_params: {
'Name': 'Example Name'),
'Phone': '0987654321',
'Address': 'Saigon, Vietnam'
}

})

client.track({
user_id: '52rrd-242rc-2r2cc-2c09a',
event_name: 'Transaction Completed',
event_params: {
'Transaction ID': "#001",
'Total Value': 1000000,
}
});

You can refer to the example repo here