npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dvb-snowplow

v1.1.13

Published

A Q4 npm package to enable Snowplow tracking with automatic Q4 contexts.

Downloads

11

Readme


Built with Typescript Badge

Getting Started

! This library is currently still using a temporary package @q4/snowplow.

  • create .npmrc file containing the following
registry=https://registry.npmjs.org/
scope=q4
@q4:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=<NPM TOKEN>
  • add "@q4/snowplow": "X.X.X" to the package.json as a dependency

How to contribute?

Contributions welcome! This is how you can contribute and test the package:

  1. Make the updates in the local package q4mobile/snowplow. Run npm link to prepare the package to run locally.
  2. Open the repository q4mobile/snowplow-schemas/demo and link to the local package with npm link q4mobile/snowplow

Changelog

View changes here

Default usage of the package:

import { Q4Snowplow } from '@q4/snowplow';

Q4Snowplow.init(config.snowplow.trackerId, config.snowplow.trackerUrl);

// Add product info
Q4Snowplow.setProductContext({ productId: 'EP', productDomain: 'attendee', productVersion: 'v4.10.0' });

// Add a user info
Q4Snowplow.setUserEmail('[email protected]');

// Create and update a custom context (persistent data sent with all events)
Q4Snowplow.createActiveContext('iglu:com.q4inc/event-entity/jsonschema/1-0-2');
Q4Snowplow.setActiveContext({ meetingId: '654321', eventStatus: 'started' });

// Track a pageview
Q4Snowplow.trackPageView();

// Dispatch an event
Q4Snowplow.trackEvent('iglu:com.q4inc/event-registration-success/jsonschema/1-0-0', { registrationType: 'attendee' });

How to add a new event?

  1. Create a new Schema URL.
  2. Call the event with: Q4Snowplow.trackEvent('{new schema url}', {registrationType: 'attendee'});

How to update the ProductContext, UserContext or ActiveContext? (Entity that is persistent across all events)

  1. Create a new Schema URL.
  2. Call the event with: Q4Snowplow.createActiveContext('{new schema url}');
  3. Add context data with: Q4Snowplow.setActiveContext({ meetingId: '654321', eventStatus: 'started' });

How to add a Plugin?

Snowplow has a large list of Plugins. Which allow you to automatically collect a large amount of data (+130 possible data points).

Below is an example of the Media Tracking plugin

Plugin details at: Media Tracking.

Install with:

npm install @snowplow/browser-plugin-form-tracking

Add the following code to the file with the tracker:

import { MediaTrackingPlugin, enableMediaTracking } from '@snowplow/browser-plugin-media-tracking';

Q4Snowplow.addPlugin({ plugin: MediaTrackingPlugin() });
enableMediaTracking({ id: 'q4-ep-react-player' });

// Automatically track video control events, such as play, pause, volume, playback speed, etc.
<ReactPlayer id="q4-ep-react-player" url="... video url..." controls />;