Log In  |  Sign Up  |  Help

Analytics

The Analytics resource allows for the retrieval of traffic statistics for a given site or for a set of sites.

Analytics API has a daily rate limit. You can't exceed 300 API calls per day per method. An error will be returned by the API in case this limit is exceeded.

Resource URIs

Get Site Analytics

GET /analytics/site/{site_name}

Query String Parameters:

Query String ParameterTypeRequiredDescription
from Date optional, defaults to 30 days prior to "to" value Start Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)
to Date optional, defaults to current date End Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)
dimension String optional, either: "system" or "geo", default is none The type of dimension to query the data by: (1) system: Set including Browser Type, Browser Version and Operating System, or (2) geo: Country (and Region where available)
result String optional, either: "traffic" or "activities", default is "traffic" Whether to return results with traffic metrics (visits, unique visitors, pageviews), or to return results with activities metrics (click_to_calls, click_to_maps, click_to_emails, form_submits)
Note:

If neither the "from" parameter nor the "to" parameter is provided, the queried period will be the past 30 days.

If only the "from" parameter is provided, the queried period will be the "from" date until today.

If only the "to" parameter is provided, the queried period will be from 30 days prior to the "to" date until the "to" date.

Return:

If the result parameter is "traffic":

If a dimension set is provided, an array containing the following JSON elements for each row of the result set.

If no dimension set is provided, a JSON structure containing the following elements.

PropertyTypeDescription
dimension JSON Structure A single dimension pertaining to the queried dimension type (if a dimension type was sent). Ex: The "geo" dimension type may return "dimension":{"Country":"Canada","Region":"Ontario"}
visits integer For the queried period and for the specified dimension, the number of visits to the site.
unique_visitors integer For the queried period and for the specified dimension, the number of unique visitors to the site.
page_views integer For the queried period and for the specified dimension, the number of page views to the site.
If the result parameter is "activities":

If a dimension set is provided, an array containing the following JSON elements for each row of the result set.

If no dimension set is provided, a JSON structure containing the following elements.

PropertyTypeDescription
dimension JSON Structure A single dimension pertaining to the queried dimension type (if a dimension type was sent). Ex: The "geo" dimension type may return "dimension":{"Country":"Canada","Region":"Ontario"}
click_to_calls integer For the queried period and for the specified dimension, the number of click-to-call actions on the site.
click_to_maps integer For the queried period and for the specified dimension, the number of click-to-map actions on the site.
click_to_emails integer For the queried period and for the specified dimension, the number of click-to-email actions on the site.
form_submits integer For the queried period and for the specified dimension, the number of form submission actions on the site.
JSON Structure:

Querying: Traffic, not dimensioned:

{"UNIQUE_VISITORS":50,"VISITS":100,"PAGE_VIEWS":150}

Querying: Activities, not dimensioned:

{"CLICK_TO_EMAILS":2,"FORM_SUBMITS":5,"CLICK_TO_MAPS":15,"CLICK_TO_CALLS":20}

Querying: Traffic, Dimensioned by geo:

[ {
    "data" : {
        "UNIQUE_VISITORS" : 50,
        "PAGE_VIEWS" : 150,
        "VISITS" : 100
    },
    "dimension" : {
        "country" : "US",
        "region" : "CA"
    }
}, {
    "data" : {
        "UNIQUE_VISITORS" : 50,
        "PAGE_VIEWS" : 150,
        "VISITS" : 100
    },
    "dimension" : {
        "country" : "US",
        "region" : "FL"
    }
}, {
    "data" : {
        "UNIQUE_VISITORS" : 50,
        "PAGE_VIEWS" : 150,
        "VISITS" : 100
    },
    "dimension" : {
        "country" : "Canada",
        "region" : "Ontario"
    }
} ]

Errors:

InvalidInput

Example:
GET /analytics/site/mymusic?from=2012-09-04&to=2012-09-05

Get Sites with Most Traffic

GET /analytics/sites/withmosttraffic

Query String Parameters:

Query String ParameterTypeRequiredDescription
from Date optional, defaults to 30 days prior to "to" value Start Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)
to Date optional, defaults to current date End Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)
Note:

If neither the "from" parameter nor the "to" parameter is provided, the queried period will be the past 30 days.

If only the "from" parameter is provided, the queried period will be the "from" date until today.

If only the "to" parameter is provided, the queried period will be from 30 days prior to the "to" date until the "to" date.

Return:

Array containing the following JSON elements for each row of the result set, representing the 10 sites with the greatest number of visits for the queries period:

PropertyTypeDescription
site_name string The mobile site name. The site name is a unique identifier of the mobile Site.
visits integer For the queried period, the number of visits to the site.
unique_visitors integer For the queried period, the number of unique visitors to the site.
pageviews integer For the queried period, the number of pageviews on site.
JSON Structure:
[ { 
    "data" : {
         "UNIQUE_VISITORS":50,
         "VISITS":100,
         "PAGE_VIEWS":150
    },
    "site_name" : "mymusic_1"
}, { 
    "data" : {
          "UNIQUE_VISITORS":20,
          "VISITS":40,
          "PAGE_VIEWS":75
     },
     "site_name" : "mymusic_2"
} ]

Errors:

InvalidInput

Example:
GET /analytics/sites/withmosttraffic?from=2012-09-04&to=2012-09-05