Miss any of our Open RFC calls?Watch the recordings here! »

snowplow-react-native-tracker

0.1.23 • Public • Published

Snowplow react native tracker

Snowplow tracker for react and react-native

Snowplow react native tracker works exactly like Snowplow Node.js Tracker because its the base of this package.

The documentation i will provide here will be limited however here you can find extended documentation

Installing

Using npm:

$ npm install snowplow-react-native-tracker --save

Initialization

var snowplow = require('snowplow-react-native-tracker');
var emitter = snowplow.emitter;
var tracker = snowplow.tracker;
First, initialize an emitter instance. This object will be responsible for how and when events are sent to Snowplow.
 
var e = emitter(
  'myscalastreamcollector.net', // Collector endpoint
  'http', // Optionally specify a method - http is the default
  8080, // Optionally specify a port
  'POST', // Method - defaults to GET
  5, // Only send events once n are buffered. Defaults to 1 for GET requests and 10 for POST requests.
  function (error, body, response) { // Callback called for each request
    if (error) {
      console.log("Request to Scala Stream Collector failed!");
    }
  }
);

Initialise a tracker instance like this:

var t = tracker([e], 'myTracker', 'myApp', false);

You can continue reading the extended documentation for more info.

Install

npm i snowplow-react-native-tracker

DownloadsWeekly Downloads

204

Version

0.1.23

License

MIT

Homepage

none

Last publish

Collaborators

  • avatar