All Projects → globocom → jquery-eventtracker

globocom / jquery-eventtracker

Licence: BSD-3-Clause License
jquery.eventtracker is a jQuery plugin wrapper for Google Analytics custom event tracker

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language

Build Status

jQuery Eventtracker

jquery.eventtracker is a jQuery plugin wrapper for Google Analytics custom event tracker

Browser Compatibility

  • IE 7+
  • Firefox 3.6+
  • Chrome 4+
  • Safari 5+
  • Opera 10.10+

Dependencies

In a nutshell

This is a simple example of how to use the plugin

$.fn.trackEvents.notifyAnalytics({
   category: "some category",
   action: "action name",
   content: "the value"
});

HTML-based declarative tracking

There's an easier way to track simple kinds of events (i.e. links):

HTML:

<a href="/to/url" class="tracking" data-event-category-action-click="content">Link</a>

Javascript:

$(".tracking").trackEvents({
  delay: 250
});

Doing this, to add tracking to a new link is just a matter of adding a class tracking to that link and configuring the event data by appending the attribute data-event-[category]-action-[action]="content" to it.

Plugin options

  • delay(250): The delay time to notify analytics
  • category: The category of custom event
  • action: The action of event
  • content: The content to shown in analytics event tracker page analysis

Authors

License

Copyright (c) 2012 Globo.com - Webmedia. See COPYING for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].