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
- Host: GitHub
- URL: https://github.com/begriffs/autolytics
- Owner: begriffs
- Created: 2013-02-12T00:17:47.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2013-09-06T01:59:36.000Z (over 12 years ago)
- Last Synced: 2025-01-10T17:50:18.110Z (about 1 year ago)
- Homepage:
- Size: 145 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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
// ... 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.