Authentication Required
API Key
Parameters
Required
Optional
visitorId |
ID number of the visitor |
direction |
up or down, direction to navigate in visitor list. |
score |
Parameter from previous visitor used when navigating up and down the visitor list |
Returns
JSON ONLY. Visitor object containing keys:
| Key | Type | Description |
params |
Object |
Object containing all client information about the visitor, as detailed below |
pages |
Array |
Array of page objects detailing all pages in the visitor's current browsing session |
events [optional] |
Array |
Array of event objects detailing all custom events fired in the visitor's current browsing session |
Params
| Key(s) | Description |
browserName and browserVersion |
Browser details, as per browser codes |
country, country_name, city, latitude, longitude and region |
Geolocation information. country as per ISO-3166 alpha-2. |
screenwidth, screenheight and colordepth |
Screen parameters. Dimensions in pixels and depth in bits per pixel |
customName |
Custom visitor name set using GoSquared.VisitorName in tracking code. |
customParams |
String of custom params, in the format "key1=value1|key2=value2" |
events and trail_pageviews |
Respectively, the number of events and pages stored in events and pages |
flash |
Flash version if enabled , "-" if not. |
java |
1 if Java is enabled, 0 if not |
language |
IETF language code for visitors browser default language |
platformName, platformVersion and numericPlatformVersion |
Platform information as per platform codes |
referrer |
Referring URL |
organic [optional] |
Object containing organic referrer information.
engine |
Search engine name |
query |
Search query |
|
returning |
1 if the visitor has visited the site before, 0 otherwise |
score |
Internal variable, should be passed back to this function when navigating up or down the list |
total_pageviews and visits |
Respectively, total number of pages this visitor has viewed and total number of separate browsing sessions from this visitor |
Page
| Key | Type | Description |
title |
String |
Title of the page |
path |
String |
Path to the page, not including the domain |
domain |
String |
Domain name of the page |
protocol |
String |
Protocol at which the page is accessed (e.g. http:) |
landTime |
Integer |
UNIX timestamp of precisely when the visitor opened the page |
state |
String |
Either focus or blur, indicating whether the visitor is currently engaging with the page |
exit [optional] |
String |
Set to a string value when the page has been unloaded, undefined if the page is still open |
exitTime |
Integer |
If the page has been unloaded, UNIX timestamp of when the page was unloaded |
Event
| Key | Type | Description |
gs_evt_name |
String |
Name of the event |
gs_evt_time |
Integer |
UNIX timestamp of when the event was fired |
gs_evt_page |
Integer |
Index of the page within the visitor's pages on which the event was fired |
caption |
String |
Event caption |
Plus any other parameters supplied to the tracker's TrackEvent function |
Complexity Cost
2 units.
Example Request
http://api.gosquared.com/visitor?api_key=API_KEY&site_token=GSN-1234567-X&visitorId=123456789
Example Response
{
"visitor": {
"events": {
"0": {
"caption": "",
"gs_evt_name": "Settings - Changed Tab",
"gs_evt_page": "2",
"gs_evt_time": "1309874556"
},
"1": {
"caption": "",
"gs_evt_name": "Settings - Changed Tab",
"gs_evt_page": "2",
"gs_evt_time": "1309874557"
}
},
"pages": [
{
"title": "GoSquared - real-time web analytics",
"path": "/",
"domain": "www.gosquared.com",
"protocol": "http:",
"landTime": 1309874419,
"state": "focus",
"exit": "timeout",
"exitTime": 1309874439
},
{
"title": "GoSquared real time web analytics - About",
"path": "/about/",
"domain": "www.gosquared.com",
"protocol": "http:",
"landTime": 1309874439,
"state": "blur"
},
{
"title": "GoSquared - Settings",
"path": "/settings/",
"domain": "www.gosquared.com",
"protocol": "https:",
"landTime": 1309874531,
"state": "focus"
}
],
"params": {
"browserName": "chrome",
"browserVersion": "14.0.810.0",
"city": "London",
"colordepth": 32,
"country": "GB",
"country_name": "United Kingdom",
"customName": "JT",
"customParams": "User ID=1|Plan=Extreme",
"events": 8,
"flash": "10.3 r181",
"id": 123456789,
"ip": "123.123.123.123",
"java": 1,
"language": "en-gb",
"latitude": 51.5,
"longitude": -0.13,
"numericPlatformVersion": 6.1,
"organic": {
"engine": "google",
"query": "Real-time web analytics"
},
"platformName": "win",
"platformVersion": 6.1,
"referrer": "http://www.google.com/search?q=Real-time+web+analytics",
"region": "H9",
"returning": 1,
"score": 1309860290,
"screenheight": 1200,
"screenwidth": 1920,
"total_pageviews": 29616,
"trail_pageviews": 163,
"visits": 13166
}
}
}
Last modified: 3 April 2012 12:17