Request Details:
Endpoint: https://api.hubapi.com/analytics/v2/reports/totals/traffic
HTTP Method: GET
Authorization: Bearer token (with proper scopes for analytics access)
Headers:
Content-Type: application/json
Authorization: <Bearer Token>
Token used in Bearer Token:
Request Body:
{
“filters”: [
{
“property”: “contentType”,
“operator”: “IN”,
“value”: [“blog”, “landingPage”, “websitePage”]
}
],
“breakdowns”: [
“contentType”,
“source”
],
“timeRange”: {
“startDate”: “2023-12-01”,
“endDate”: “2023-12-31”
}
}
Error:
-
{
status:“error”,
message:“Use summarized points for totals resource”,
correlationId:“e9058c03-41e1-453e-a707-ebcdf437c056”
}
What I Am Trying to Achieve:
I am attempting to:
Retrieve traffic data for a date range
Filter the data by content types: blog posts, landing pages, and website pages.
Break down the results by content type and traffic source.
I have reviewed the API documentation and tested the request in multiple ways (e.g., simplifying the payload, removing filters and breakdowns), but the issue persists.
i am storing the information in a data base so i could technically use a few differant calls to get the data i want but want the most simplified version possible. has anyone gotten this data in such a way or have ideas?
Hi @MLundy1
I have had a quick look at this and it appears the endpoint is incorrect.
Can you try something like this ?
https://api.hubapi.com/analytics/v2/reports/sources/total?start=20231201&end=20231231
I believe this should give you what you are looking for but if there any issues feel free to reach out.
Also, I noticed you have included you private key in your post. I strongly recommend removing this from this post.
Let me know if you need any more help.
Pauric
p.mcconnell@baskey.eu
https://www.linkedin.com/in/pauric-mc-connell/
Hey,
Thanks for the response and the hint about the key forgot to remove it!
using the endpoint you suggest only returns the results broken down by source(organic,direct, etc) for ALL content types.
i would need it broken down by content type and then by source. i would like to report on for example standard pages that have direct traffic or other combinations.
do you have a suggestion for that?
Hi @MLundy1 ,
Sorry for my delay here but it seems like a tricky issue tbh. I can’t find a way to link the content type data back to the source data, as the source data does not contain content type or page id in the response.
So I don’t think going through the api is the right direction.
I have had a look through the Create Report option in the portal and you can create a report for each content type and map page views to Contact source. I know this may not be exactly what you are looking for but there doesn’t seem to be a way to map total views to the traffic source. But perhaps I am missing something so it could be worth exploring.