0.9.7 • Published 3 months ago

dobbin-twitch v0.9.7

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Dobbin

Dobbin is a client side tracking library that lets you send events to our internal analytics platform Spade, as well as Mixpanel. You can get help with Dobbin in the #site-performance Slack channel. For Spade questions, visit the #scieng Slack channel.

import { Dobbin, SPADE_SERVICE, MIXPANEL_SERVICE } from 'dobbin';

Dobbin.trackEvent('signup-user', { referrer: 'https://twitch.tv/prime' }, [SPADE_SERVICE, MIXPANEL_SERVICE]);

API

Dobbin.configure({ Promise, useSendBeacon, serviceUrls, serviceBatchSizes, siteOptions })

  • Promise: Dobbin doesn't ship with a Promise library to minimize its payload size, so you need to pass in the Promise object as a config option.
  • useSendBeacon: Use sendBeacon to send the data if it is available.
  • serviceUrls: URLs for Spade and Mixpanel, mostly with testing in mind. In the form {spade: {href: <url>}, mixpanel: {href: <url>}}.
  • serviceBatchSizes: Maximum batch size for each service, mostly with testing in mind.
  • siteOptions: the SiteOptions object, which contains the current spade URL in an experiment.

Dobbin.trackEvent(name, data, services);

  • name - String - the name of your event
  • data - Object - a hash of properties attached to the event
  • services - Array - (Optional) a list of services that should receive the event. Valid services are "spade" and "mixpanel", default is ["spade", "mixpanel"].

Development

  • npm install - Install dependencies
  • npm run build - Builds the assets.
  • npm run lint - Runs the linter.
  • npm run test - Runs tests once.
  • npm run test:watch - Runs a test server and watches for changes.
0.9.7

3 months ago