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

action-tracker

v1.2.1

Published

The easy-to-use library for Google Analytics's tracking.

Downloads

655

Readme

action-tracker.js

The easy-to-use library for Google Analytics's tracking.

npm version Bower version Build Status Codacy Badge Code Climate Test Coverage Dependency Status

Installation

bower:

bower install --save action-tracker

npm:

npm install --save action-tracker

Examples

<script src="dist/action-tracker.min.js"></script>
<script>
  ga('create', {YOUR PROPERTY ID})
</script>
<script>
  var tracker = ActionTracker()

  $('a[data-tracker]').on('click', function () {
    tracker.emit('anchor', 'click', $(this).text())
  })
</script>

Documantation

tracker(options)

Create a tracker. By default property id is null. In the case we will use the configured of ga object.

  • options.id [optional] ... Analytics's property id.
  • options.name [optional] ... Tracker's name option. Call the method with a name (ga('name.method', value)) when you specify.

tracker.set(name, value)

Set the name and value to the ga object.

  • name [required] ... The fields's name.
  • value [required] ... The fields's value.

tracker.send(name [, options])

Call the send method from ga object.

  • name [required] ... The method name.
  • options [optional] ... The object of the fields you want to send. By default send null.

tracker.pageview([path])

Send the page-view.

  • path [optional] ... The URL's path for send. By default send the tracker.get('path')

tracker.emit(category, action, label [, value])

Send event.

  • category [required] ... Event category.
  • action [required] ... Event action.
  • label [optional] ... Event label. By default, set a ''.
  • value [optional] ... Event value. By default, set a null.

tracker.exception(error_message, options)

Send the exception.

  • error_message [required] ... description of the exception or Error object. serialize to json format string.
  • options.fatal [optional] ... GA's exFatal flag. By default, set a false.

LICENSE

MIT