forked from codejoust/session.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Iain Nash
committed
Jan 6, 2012
1 parent
cffa832
commit ff65c15
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,64 @@ | ||
Visitor.js | ||
== | ||
|
||
Open-Source version of visitor.js. | ||
|
||
To use: include the file visitor.js, then access the visitor object. | ||
For async loading, use the window.visitor_loaded callback. | ||
|
||
To add more fields, add more modules torwards the bottom of the js file. | ||
|
||
API demo dump: | ||
``` | ||
{ | ||
"locale": "en-US", | ||
"cur_session": { | ||
"visits": 1, | ||
"search": { | ||
"engine": null, | ||
"query": null | ||
}, | ||
"referrer": "http://localhost:8000/", | ||
"url": "http://localhost:8000/demo.html", | ||
"path": "/demo.html", | ||
"start": 1325887305691, | ||
"last_visit": 1325887305691 | ||
}, | ||
"orig_session": { | ||
"visits": 2, | ||
"search": { | ||
"engine": null, | ||
"query": null | ||
}, | ||
"referrer": "http://localhost:8000/", | ||
"url": "http://localhost:8000/test_visitor.html", | ||
"path": "/test_visitor.html", | ||
"start": 1325886709703, | ||
"last_visit": 1325887305692 | ||
}, | ||
"browser": { | ||
"browser": "Chrome", | ||
"version": 16, | ||
"OS": "Mac" | ||
}, | ||
"plugins": { | ||
"flash": true, | ||
"silverlight": true, | ||
"java": true, | ||
"quicktime": true | ||
}, | ||
"device": { | ||
"screen": { | ||
"height": 1024, | ||
"width": 1280, | ||
}, | ||
"viewport": { | ||
"width": 1206, | ||
"height": 816 | ||
}, | ||
"is_phone": false, | ||
"is_tablet": false, | ||
"is_mobile": false | ||
} | ||
} | ||
``` |