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

@circulare/usage-tracker-browser

v0.0.3

Published

A usage tracking library for browser

Downloads

6

Readme

@circulare/usage-tracker-browser

npm version

This library is a wraper of mixpanel-browser

This library currently does not support group tracking and some functions from the people context.

Getting Started

This library is available as a package on NPM named @circulare/usage-tracker-browser (not to be confused with the node version). To install into a project using NPM with a front-end packager such as Browserify or Webpack:

npm install --save @circulare/usage-tracker-browser

You can then require the lib like a standard Node.js module:

Usage

The token passed to .init() is the project token on your Mixpanel account. More information on how to locate the project token can be found here.

import mixpanel from '@circulare/usage-tracker-browser';

mixpanel.init('MIXPANEL_TOKEN', options);
mixpanel.track('An event');

API Reference

  • init(mixpanel_token[, options]) – Loads the token used to identify the mixpanel project and sets some configurations
    • mixpanel_token - Mixpanel project token
    • options
      • debug:boolean
      • track_pageview:boolean
      • persistence:string
      • For more options see the mixpanel docs
  • track(channelName[, properties]) – tracks an event
    • channelName:string - Name of the event to track
    • properties:object - Any key:value pair to add to the tracking info.
  • track_pageview(properties) – The track_pageview option currently does not auto-track page views in single-page applications. For single-page applications or other manual page view tracking, Mixpanel offers the standard page view event through mixpanel.track_pageview(). This call can be inserted into any hooks or listeners for your framework of choice.
    • properties:object - The standard page view event includes the page title, URL components, and marketing parameters described below. Additional page view event properties can also be added as event properties.