Reports
Using reports through the api.
Endpoints
Filters#
All reports can now be filtered with the filters property in the request body.
| Parameter | Type | Description |
|---|---|---|
path | string | Name of URL. |
referrer | string | Name of referrer. |
title | string | Name of page title. |
query | string | Name of query parameter. |
browser | string | Name of browser. |
os | string | Name of operating system. |
device | string | Name of device (ex. Mobile). |
country | string | Name of country. |
region | string | Name of region/state/province. |
city | string | Name of city. |
language | string | Name of browser language. |
hostname | string | Name of hostname. |
tag | string | Name of tag. |
event | string | Name of event. |
distinctId | string | Name of distinct ID. |
utmSource | string | UTM source. |
utmMedium | string | UTM medium. |
utmCampaign | string | UTM campaign name. |
utmContent | string | UTM content. |
utmTerm | string | UTM term. |
segment | uuid | UUID of segment. |
cohort | uuid | UUID of cohort. |
Request body
GET /api/reports#
Get all reports by website ID.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (attribution | breakdown | funnel | goal | journey | retention | revenue | utm). |
page | number | (optional, default 1) Determines page. |
pageSize | number | (optional) Determines how many results to return. |
Sample response
POST /api/reports#
Creates a report.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (attribution | breakdown | funnel | goal | journey | retention | revenue | utm). |
name | string | Name of report. |
description | string | (optional) Description of report. |
parameters | object | Parameters for report. |
Request body
Sample response
GET /api/reports/:reportId#
Gets a report by ID.
Sample response
POST /api/reports/:reportId#
Updates a report.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (attribution | breakdown | funnel | goal | journey | retention | revenue | utm). |
name | string | Name of report. |
description | string | (optional) Description of report. |
parameters | object | Parameters for report. |
Request body
Sample response
DELETE /api/reports/:reportId#
Deletes a report.
Sample response
POST /api/reports/attribution#
See how users engage with your marketing and what drives conversions.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (attribution). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
model | string | Attribution model (first-click | last-click). |
type | string | Conversion type (path | event). |
step | string | Conversion step. |
Request body
Sample response
POST /api/reports/breakdown#
Dive deeper into your data by using segments and filters.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (breakdown). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
fields | array | List of column fields. |
Available Fields
path | title | query | referrer | browser | os | device | country | region | city | hostname | tag | event | distinctId |
utmSource | utmMedium | utmCampaign | utmContent | utmTerm |
Request body
Sample response
POST /api/reports/funnel#
Understand the conversion and drop-off rate of users.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (funnel). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
steps | array | Minimum two required. Each step has a type (path | event) and a value. |
window | number | Window of days between funnel steps to be considered a conversion. |
Request body
Sample response
POST /api/reports/goal#
Track your goals for pageviews and events.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (goal). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
type | string | Conversion type (path | event). |
value | string | Conversion step value. |
Request body
Sample response
POST /api/reports/journey#
Understand how users navigate through your website.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (journey). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
steps | number | Number of steps from 3 to 7. |
startStep | string | Starting step URL or event name. |
endStep | string | (optional) Ending step URL or event name. |
Request body
Sample response
POST /api/reports/performance#
Get Core Web Vitals performance metrics for a given date range.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (performance). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
unit | string | (optional) Time unit (year | month | hour | day). |
timezone | string | (optional) Timezone (ex. America/Los_Angeles). |
metric | string | (optional) Metric to focus on (lcp | inp | cls | fcp | ttfb). |
Request body
Sample response
POST /api/reports/retention#
Measure your website stickiness by tracking how often users return.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (retention). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
timezone | string | Timezone (ex. America/Los_Angeles). |
Request body
Sample response
POST /api/reports/revenue#
Get currency for given range. Needed for Revenue and optional in Attribution reports.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (revenue). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
timezone | string | Timezone (ex. America/Los_Angeles). |
currency | string | Currency code (ISO 4217). |
compare | string | (optional) Comparison period (prev | yoy). |
Request body
Sample response
GET /api/websites/:websiteId/revenue/chart#
Returns revenue chart data for a given date range and currency.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Start date in Unix milliseconds. |
endAt | number | End date in Unix milliseconds. |
timezone | string | Timezone (ex. America/Los_Angeles). |
currency | string | Currency code (ISO 4217). |
compare | string | (optional) Comparison period (prev | yoy). |
Sample response
GET /api/websites/:websiteId/revenue/stats#
Returns revenue statistics for a given date range with optional comparison period.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Start date in Unix milliseconds. |
endAt | number | End date in Unix milliseconds. |
timezone | string | Timezone (ex. America/Los_Angeles). |
currency | string | Currency code (ISO 4217). |
compare | string | (optional) Comparison period (prev | yoy). |
Sample response
GET /api/websites/:websiteId/revenue/metrics#
Returns revenue broken down by a specified dimension.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Start date in Unix milliseconds. |
endAt | number | End date in Unix milliseconds. |
timezone | string | Timezone (ex. America/Los_Angeles). |
type | string | Breakdown type (country | region | referrer | channel). |
currency | string | Currency code (ISO 4217). |
Sample response
GET /api/websites/:websiteId/revenue/sessions#
Returns a paginated list of sessions with revenue data.
Parameters
| Parameter | Type | Description |
|---|---|---|
startAt | number | Start date in Unix milliseconds. |
endAt | number | End date in Unix milliseconds. |
timezone | string | Timezone (ex. America/Los_Angeles). |
currency | string | Currency code (ISO 4217). |
page | number | (optional) Page number. |
pageSize | number | (optional) Number of results per page. |
search | string | (optional) Search term to filter sessions. |
Sample response
POST /api/reports/utm#
Track your campaigns through UTM parameters.
Parameters
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Your website id. |
type | string | Report type (utm). |
filters | object | Can accept filter parameters. |
startDate | string | Start date. |
endDate | string | End date. |
Request body
Sample response