Web analytics
For instructions on how to authenticate to use this endpoint, see API overview.
This endpoint is in Concept state, please join the feature preview to try it out when it's ready. Get a breakdown by a property (e.g. browser, device type, country, etc.).
Endpoints
GET | |
GET |
Retrieve web analytics breakdown
Required API key scopes
query:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- apply_path_cleaningbooleanDefault:
trueApply URL path cleaning
- breakdown_bystringOne of:
"DeviceType""Browser""OS""Viewport""InitialReferringDomain""InitialUTMSource""InitialUTMMedium""InitialUTMCampaign""InitialUTMTerm""InitialUTMContent""Country""Region""City""InitialPage""Page""ExitPage""InitialChannelType"Property to break down by
DeviceType- DeviceTypeBrowser- BrowserOS- OSViewport- ViewportInitialReferringDomain- InitialReferringDomainInitialUTMSource- InitialUTMSourceInitialUTMMedium- InitialUTMMediumInitialUTMCampaign- InitialUTMCampaignInitialUTMTerm- InitialUTMTermInitialUTMContent- InitialUTMContentCountry- CountryRegion- RegionCity- CityInitialPage- InitialPagePage- PageExitPage- ExitPageInitialChannelType- InitialChannelType
- date_fromstring
Start date for the query (format: YYYY-MM-DD)
- date_tostring
End date for the query (format: YYYY-MM-DD)
- filter_test_accountsbooleanDefault:
trueFilter out test accounts
- hoststring
Host to filter by (e.g. example.com)
- limitintegerDefault:
100Number of results to return
- offsetintegerDefault:
0Number of results to skip
Response
Example request
GET /api /projects /:project_id /web_analytics /breakdownExample response
Status 200 Get a breakdown of web analytics data by supported properties.
Retrieve web analytics overview
This endpoint is in Concept state, please join the feature preview to try it out when it's ready. Get an overview of web analytics data including visitors, views, sessions, bounce rate, and session duration.
Required API key scopes
query:readPath parameters
- project_idstring
Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
Query parameters
- date_fromstring
Start date for the query (format: YYYY-MM-DD)
- date_tostring
End date for the query (format: YYYY-MM-DD)
- filter_test_accountsbooleanDefault:
trueFilter out test accounts
- hoststring
Host to filter by (e.g. example.com)
Response
Example request
GET /api /projects /:project_id /web_analytics /overview