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-insights

v0.6.2

Published

The Ember.js addon for tracking web analytics and user experience

Downloads

14

Readme

Hey, listen! This is alpha-level software with planned future changes (check out CHANGELOG each time after releasing MINOR milestone). Users's metrics are extensive, and not trivial to implement. ember-insights.js is heavily based on Google Analytics (with ability to add others).

Build Status NPM version NPM Downloads Ember Observer Score License

Getting started

$ ember install:addon ember-insights

Use blueprint for generating configs and initializer.

$ ember generate ember-insights-initializer ember-insights

Or just drop an initializer manually.

import EmberInsights from 'ember-insights';

export default {
  name: 'ember-insights',
  initialize: function(/*container, application*/) {
    EmberInsights.configure().track().start();
  }
};

In additional, there is available an AMD module and Bower component, find more details here ember-insights.amd.js.

Live demo

The easiest way to find out more details is checking live demo and their sources.

Getting more details

This section describes how-to tweak configuration for what you need.

import EmberInsights from 'ember-insights';

There are a couple of separate steps for specifying tracking such as configure, track and finally start and stop.

The simplest way to start tracking by default:

EmberInsights.configure().track().start();

Defines a default environment with ConsoleTracker and sends all transitions and actions to Ember.Logger.log.

#configure/2 and #configure/0 (as a default convinience)

Defines environment-specific trackers and their options.

  • name - Specifies name, sets default name by default.
  • settings - Defines options such as:
    • debug:boolean - Pushes messages into Ember.debug, sets true by default.
    • trackerFactory:function - Tracker, uses an EmberInsights.ConsoleTracker by default.
    • trackTransitionsAs:string - Defines how to track transitions (available options are pageview and event), uses a pageview by default.

Here is a configure/2 example:

EmberInsights.configure('default', {
  debug: true,
  trackerFactory: EmberInsights.ConsoleTracker.factory,
  trackTransitionsAs: 'pageview'
});

Which is the same as available by default:

EmberInsights.configure();

Tips: Trackers wiki has more specific details.

#track/1 and #track/0 (as a default convinience)

insights

Defines what exactly should be tracked and what kind of things should be ignored at all.

Here is a track/1 example:

EmberInsights.configure().track({
  insights: { ALL_TRANSITIONS: true, ALL_ACTIONS: true }
});

Which is the same as available by default:

EmberInsights.configure().track();

Keep in mind that track/1 could be used for specifying particular piece of application that should(not) be tracked. You are able to call the track/1 in chain.

}).track({
  insights: { /*specific part of application that should(not) be tracked */ }
}).track({
  insights: { /*specific part of application that should(not) be tracked */ }
});

Each insights definition could provide its own dispatcher function and overwrite default dispatcher. The dispatch/3 enables you to submit a custom insight other that sends by default in context of specific track/1 definition.

}).track({
  insights: { /*specific part of application that should(not) be tracked */ },
  dispatch: function(type, context, tracker) {
    tracker.sendEvent(/*specific event*/);
    tracker.sendEvent(/*specific event*/);
  }
}).track({
  insights: { /*specific part of application that should(not) be tracked */ }
});

Tips: Tracking mappings page has more specific details.

timing

Defines ability to send a timing report. This feature is based on HTML5: User Timing API and works just only for particular browsers.

.track({ timing: { transitions: true } });

#start/1 and #stop/0

Runtime management. So that, you are be able to start by environment name and stop tracking at all.

var emberInsights = EmberInsights.configure(/*options*/).track(/*mappings*/);
// ...
emberInsights.start();
// ...
emberInsights.stop();

Advanced #configure/1

This one provides you a bit different way for specifying environments as described before. The main purpose is ability to specify environments and apply all further tracks for all environments recursively.

Here is a short example:

EmberInsights.configure({
  'development': { trackerFactory: EmberInsights.ConsoleTracker.factory },
  'production':  { trackerFactory: EmberInsights.GoogleTracker.factory },
}).track({
  insights: { /*specific part of application that should(not) be tracked */ }
}).track({
  insights: { /*specific part of application that should(not) be tracked */ }
});

It provides ability to drop a message to Ember.Logger.log console for development and sends insights into the Google Analytics in production mode.

Ask for help

Check out the wiki. If you feel like porting or fixing something, please drop a pull request or issue tracker at GitHub! Check out the CONTRIBUTING.md for more details.

I believe that with the help of everyone we can bring this to Ember in a modular and robust way.

Acknowledgement

Project's HEAD repository is https://github.com/ember-insights/ember-insights.

Analytics