Browse Source

Updated the markdown

bmallred 12 years ago
parent
commit
29e59545c8
2 changed files with 51 additions and 2 deletions
  1. 50 0
      README.md
  2. 1 2
      jquery-analytics.js

+ 50 - 0
README.md

1
jquery-analytics
1
jquery-analytics
2
================
2
================
3
3
4
Description
5
-----------
6
4
jQuery plug-in to provide custom analytics. For those of us who can not use Google Analytics at work or just want to dork with something else.
7
jQuery plug-in to provide custom analytics. For those of us who can not use Google Analytics at work or just want to dork with something else.
8
9
Easy to use
10
-----------
11
12
With just a few lines of code you can easily configure your own web page analytics. Just specify the URI you would like to communicate with
13
and everything is a go. 
14
15
```javascript
16
$(function () {
17
	$(".trace").analytics({
18
		url: "http://localhost/trace"
19
	});
20
});
21
```
22
23
Custom tags supported out-of-the-box
24
------------------------------------
25
26
Often you want to track more meaningful information along with what is provided. Simply apply any number of custom attributes prefixed with **"data-analytics-"** and we will take care of the rest!
27
28
```html
29
<a id="myLink" href="#" data-analytics-outfit="pajamas" data-analytics-shoes="slippers">My link</a>
30
```
31
32
This will send the following information back:
33
34
```json
35
{
36
	id: "myLink",
37
	outfit: "pajamas",
38
	shoes: "slippers"
39
}
40
```
41
42
Determining the flow
43
--------------------
44
45
It is also possible to track the flow a user goes through while visiting your page if you have an uniquely identifier piece of information. This can be done during initialization as such:
46
47
```javascript
48
$(function () {
49
	$(".trace").analytics({
50
		url: "http://localhost/trace",
51
		client: "unique identifier"
52
	});
53
});
54
```

+ 1 - 2
jquery-analytics.js

59
        attributes: [],
59
        attributes: [],
60
        assignTo: ["a", "input[type='submit']"],
60
        assignTo: ["a", "input[type='submit']"],
61
        url: null,
61
        url: null,
62
        client: null,
63
        live: false
62
        client: null
64
    };
63
    };
65
64
66
    // Walk the tree of a given node.
65
    // Walk the tree of a given node.