Authentication Required

API Key

Parameters

Required

site_token Site Token

Optional

aggregateStatsLimit Comma-delimited string of the number of entries to return in each aggregated metric.

Ordering:

[browsers] , [countries] , [languages] , [platforms]

Each square bracket represents a number for how many results to include for the corresponding metric in the response.

Returns

JSON ONLY. Object of aggregated statistics about the demographics of visitors on the site. The results are ordered descending by how many visitors fall into each group.

Key Type Description
browsers Object The browsers in use by visitors. Keys as per this list of browsers
countries Object The countries of visitors. Keys as per the ISO 3166-1 alpha-2 specification
languages Object The languages spoken by visitors. Keys as per the IETF language tag specification
platforms Object The type of platforms in use by visitors. Keys as per this list of platform groups

Each resultset includes a key "other", representing how many more visitors fall into other result groups outside the limit.

Complexity cost

2 units

Example Request

http://api.gosquared.com/aggregateStats?api_key=API_KEY&site_token=GSN-1234567-X

Example Response

{
    "aggregateStats": {
        "browsers": {
            "chrome": 25,
            "firefox": 12,
            "safari": 9,
            "ie": 3,
            "op": 1
        },
        "countries": {
            "US": 17,
            "GB": 14,
            "-": 4,
            "DE": 3,
            "FR": 2,
            "other": 10
        },
        "languages": {
            "en-us": 31,
            "en-gb": 7,
            "de-de": 3,
            "fr": 3,
            "pt-br": 2,
            "other": 4
        },
        "platforms": {
            "mac106": 22,
            "win7": 17,
            "winxp": 6,
            "winvista": 3,
            "linux": 1,
            "mac105": 1
        }
    }
}

Example Request

http://api.gosquared.com/aggregateStats?api_key=API_KEY&site_token=GSN-1234567-X&aggregateStatsLimit=1,2,3,4

Example Response

{
    "aggregateStats": {
        "browsers": {
            "chrome": 24,
            "other": 27
        },
        "countries": {
            "US": 16,
            "GB": 14,
            "other": 21
        },
        "languages": {
            "en-us": 31,
            "en-gb": 7,
            "fr": 3,
            "other": 10
        },
        "platforms": {
            "mac106": 21,
            "win7": 18,
            "winxp": 5,
            "winvista": 3,
            "other": 4
        }
    }
}
Last modified: 3 April 2012 12:11