Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including snowplow-react-native-tracker with all npm packages installed. Try it out:

var snowplowReactNativeTracker = require("snowplow-react-native-tracker")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

snowplow-react-native-tracker v0.1.23

Snowplow tracker for react and react-native.

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.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free