Endpoints

Website statistics

Operations around Website statistics.

Endpoints


Filters#

All Endpoints marked with filters can now be filtered with the parameters below.

ParameterTypeDescription
pathstringName of URL.
referrerstringName of referrer.
titlestringName of page title.
querystringName of query parameter.
browserstringName of browser.
osstringName of operating system.
devicestringName of device (ex. Mobile).
countrystringName of country.
regionstringName of region/state/province.
citystringName of city.
languagestringName of browser language.
hostnamestringName of hostname.
tagstringName of tag.
eventstringName of event.
distinctIdstringName of distinct ID.
utmSourcestringUTM source.
utmMediumstringUTM medium.
utmCampaignstringUTM campaign name.
utmContentstringUTM content.
utmTermstringUTM term.
segmentuuidUUID of segment.
cohortuuidUUID of cohort.

Unit Parameter

The unit parameter buckets the data returned. The unit is automatically converted to the next largest applicable time unit if the maximum is exceeded.

UnitMaximum
minuteUp to 60 minutes.
hourUp to 30 days.
dayUp to 6 months.
monthNo limit.
yearNo limit.

GET /api/websites/:websiteId/active#

Gets the number of active users on a website.

Sample response

  • visitors: Number of unique visitors within the last 5 minutes

GET /api/websites/:websiteId/daterange#

Gets the date range of available data for a website.

Sample response


GET /api/websites/:websiteId/events/series#

Gets events within a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
unitstringTime unit (year | month | day | hour | minute).
timezonestringTimezone (ex. America/Los_Angeles).
filtersobjectCan accept filter parameters.

Sample response

FieldDescription
xEvent name.
tTimestamp.
yNumber of events.

GET /api/websites/:websiteId/metrics#

Gets metrics for a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
typestringMetrics type.
filtersobjectCan accept filter parameters.
limitnumber(optional, default 500) Number of rows returned.
offsetnumber(optional, default 0) Number of rows to skip.

Available Types

path | entry | exit | title | query | referrer | channel | domain | country | region | city | browser | os | device | language | screen | event | hostname | tag | distinctId

Sample response

FieldDescription
xUnique value, depending on metric type.
yNumber of visitors.

GET /api/websites/:websiteId/metrics/expanded#

Gets expanded metrics for a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
typestringMetrics type.
filtersobjectCan accept filter parameters.
limitnumber(optional, default 500) Number of rows returned.
offsetnumber(optional, default 0) Number of rows to skip.

Available Types

path | entry | exit | title | query | referrer | channel | domain | country | region | city | browser | os | device | language | screen | event | hostname | tag | distinctId

Sample response

FieldDescription
nameUnique value, depending on metric type.
pageviewsPage hits.
visitorsNumber of unique visitors.
visitsNumber of unique visits.
bouncesNumber of visitors who only visit a single page.
totaltimeTime spent on the website.

GET /api/websites/:websiteId/pageviews#

Gets pageviews within a given time range.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
unitstringTime unit (year | month | day | hour | minute).
timezonestringTimezone (ex. America/Los_Angeles).
comparestring(optional) Comparison period (prev | yoy).
filtersobjectCan accept filter parameters.

Sample response

  • x: Timestamp.
  • y: Number of pageviews or visitors.

GET /api/websites/:websiteId/stats#

Gets summarized website statistics.

Parameters

ParameterTypeDescription
startAtnumberTimestamp (in ms) of starting date.
endAtnumberTimestamp (in ms) of end date.
filtersobjectCan accept filter parameters.

Sample response

FieldDescription
pageviewsPage hits.
visitorsNumber of unique visitors.
visitsNumber of unique visits.
bouncesNumber of visitors who only visit a single page.
totaltimeTime spent on the website.