Options
All
  • Public
  • Public/Protected
  • All
Menu

Event Tracking Browser

styled with prettier Known Vulnerabilities Travis Coverage Status Dev Dependencies

A project for tracking ptoject.

Usage

yarn add event-tracking-browser

or

npm install event-tracking-browser

Features

NPM scripts

  • npm t: Run test suite
  • npm start: Run npm run build in watch mode
  • npm run test:watch: Run test suite in interactive watch mode
  • npm run test:prod: Run linting and generate coverage
  • npm run build: Generate bundles and typings, create docs
  • npm run lint: Lints code
  • npm run commit: Commit using conventional commit style (husky will tell you to use it if you haven't :wink:)

Index

Functions

Const identify

  • identify(uniqueId?: undefined | string): undefined | string
  • Identify a user with a unique ID to track user activity across devices, tie a user to their events, and create a user profile. If you never call this method, unique visitors are tracked using a UUID generated the first time they visit the site.

    Parameters

    • Optional uniqueId: undefined | string

      A string that uniquely identifies a user. If not provided, the distinctId currently in the persistent store (cookie or localStorage) will be used.

    Returns undefined | string

Const init

  • This function initializes a new instance of the tracking object

    Parameters

    • token: string

      API token.

    • Optional config: EventTrackerOptions

      A dictionary of config options to override default config.

    Returns string

    distinctId.

Const register

  • register(properties: any): any
  • Register a set of super properties, which are included with all events.

    Parameters

    • properties: any

      An associative array of properties to store about the user

    Returns any

Const track

  • track(eventName: string, properties: any): { eventName: string; properties: any }
  • Track an event

    Parameters

    • eventName: string

      The name of the event. This can be anything the user does - 'Button Click', 'Sign Up', etc.

    • properties: any

      A set of properties to include with the event you're sending

    Returns { eventName: string; properties: any }

    If the tracking request was successfully initiated/queued, an object with the tracking payload sent to the API server is returned; otherwise false.

    • eventName: string
    • properties: any

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc