32.0.0 • Published 1 year ago

pulsar-analytics v32.0.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
1 year ago

Pulsar-Analytics

Player agnostic analytics implementation of Twitch video metrics.

Supported Events

  • Minute Watched
  • Video Play
  • Buffer Empty
  • Buffer Refill
  • Video Error
  • Video Ended

This package will attach primitive player information, it is up to the consumer to attach higher level environment, user, and content specific tracking fields. See src/events for the full implementation details.

Usage

yarn add pulsar-analytics
import { subscribeVideoAnalytics } from 'pulsar-analytics';

// Calling this will cleanup any listeners that were created
const unSubscribeVideoAnalytics = subscribeVideoAnalytics({
  backend: 'native',
  onTrackingEvent: (playerEvent) => {
    /*...*/
  },
  timeSinceLoadStart: Date.now(),
  video: videoElement,
});