An open API service indexing awesome lists of open source software.

https://github.com/begriffs/autolytics

An embarrassment of analytics riches
https://github.com/begriffs/autolytics

Last synced: about 1 year ago
JSON representation

An embarrassment of analytics riches

Awesome Lists containing this project

README

          

## Rich Events for Google Analytics

You collect too little data about your visitors. Use this library to
gather more data very easily.

Do this

1. Have Google Analytics already running on your site.
1. Include `jquery-autolytics.js`
1. Apply the plugin to any element on the page: `$('input, a').autolytics()`

and behold

* It will send detailed browser events to Google Analytics
* And will name the event based on CSS selectors identifying the page element

### Example

```html


A link
Another link

// ... include jquery and jquery-autolytics

$(function () {
// ... load google analytics

$('a, input').autolytics();
});

```

When I type `hi` into the input then click on the links it generates these events:

```js
["_trackEvent", "body > input", "focus"]
["_trackEvent", "body > input", "click", "228,24"]
["_trackEvent", "body > input", "keypress", 104]
["_trackEvent", "body > input", "keypress", 105]
["_trackEvent", "body > input", "change", "hi"]
["_trackEvent", "body > input", "blur"]
["_trackEvent", "body > a.other", "click", "141,24"]
["_trackEvent", "body > a.main", "click", "38,22"]
```

This is enough information to even replay the user typing in realtime!

### Why more data?

Recording events and identifying their originating dom elements can
give you information to define custom Analytics goals. You can watch
visitors' hesitation among various page elements and define goals inside
a single page, like "the user opens a menu and clicks a submenu."

### More Info

Recorded Events

EventExtra Info

blur
changenew value
clickX,Y
dblclickX,Y
focus
keypresskeycode
resizewidth x height
scrollscroll-top
submit

### Caveats

Google does impose
[limits](https://developers.google.com/analytics/devguides/collection/gajs/limits-quotas)
to the amount of information you can capture but you're probably coming
nowhere close right now, so take advantage of it. If you upgrade your
analytics account then you go collect even more.