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

ember-cli-mixpanel-service

v0.0.20

Published

Adds mixpanel as a service injected onto routes and controllers

Downloads

8

Readme

ember-cli-mixpanel-service

npm version Ember Observer Score Code Climate

This ember-cli addon injects mixpanel into your ember app.

The mixpanel js is injected into the app's index.html. Pageview tracking is by default automatic, no mixins required. The mixpanel service is injected into your apps controllers and routes and is available as this.get('mixpanel').

More on mixpanel at http://www.mixpanel.com

Installation

ember install ember-cli-mixpanel-service

Configuration

This plugin uses the ember-cli project's configuration as defined in config/environment.js.

Add your Mixpanel API token to config/environment.js and you're good to go. A couple more params below

// environment.js

    ENV.mixpanel = {
      enabled: false,
      LOG_EVENT_TRACKING: false,
      token: 'abcd123456789'
    }

Configuration Parameters

  • enabled (Default: true): Enable mixpanel tracking
  • autoPageviewTracking (Default: true): Enable automatic pageview tracking
  • pageViewAttribute (Default: url): Use some other attribute available to the router instead of url for pageview tracking
  • attributeOverrides (Default: {}): Configure overrides, if any, for any of the attributes mixpanel stores by default
  • LOG_EVENT_TRACKING (Default: false): Output logging to the console.
  • token (Default: null): Mandatory Mixpanel API token

CORS Content Security Policy

If you use ember-cli-content-security-policy you should add the Mixpanel API to your app's content security policy settings. To do this add api.mixpanel.com to the 'connect-src' key in the ENV.contentSecurityPolicy hash as below:

// environment.js
    ENV.contentSecurityPolicy = {
      'connect-src': "'self' api.mixpanel.com ..."
      ...
    }

Mixpanel API

pageviews

trackPageView: function(page, overrides = {})

Note: Pageviews are tracked automatically by default, no mixins required. You can override any properties mixpanel stores by default by providing an optional overrides object.

events

trackEvent: function(event, properties, options, callback)

Alias of the mixpanel track function

identify

identify: function(userId, traits, options, callback)

Alias of the mixpanel identify function

alias

alias: function(userId, previousId, options, callback)

Alias of the mixpanel alias function

register

register: function(traits, options, callback)

Alias of the mixpanel register function

peopleSet

peopleSet: function(attributes)

Alias of the mixpanel people.set function