The issue is, one of our HubSpot Hosted blogs is really old and it fills my results with blog posts that I don't want data for - using up way too many operations in Integromat.
The API documentation says:
"A blog ID can be specified to get data for all content related to a specific blog. The content_type must be blog-posts or listing-pages, see the examples for details."
However, in each of the examples they give, the blog ID option is always part of a sources report:
Thanks for your patience. I appreciate the added clarification.
Unfortunately, the Analytics API does not allow for such filtering at this time. I referenced our internal API catalog and confirmed that if you pass a blog's content-group ID in a request, it must be followed by /sources/.
While you currently can't exclude Social Media Blog posts from the request, there may be other ways to conserve operations.
Are you referencing this endoint for every blog post returned from /analytics/v2/reports/blog-posts/total?
If so, could you periodically update a table with all Fire & Security blog post IDs from this endpoint (using the content_group_id=1323969639 parameter) and use that to filter your results?
All this said, I definitely see the value in filtering this endpoint's non-sources results by blog, however. The team plans to release more flexible analytics endpoints in the future, but would you also mind posting a feature request describing your use case and pain here on the Ideas Forum? (I looked for similar existing ideas but found none.) Upvotes and comments help the product teams prioritize ideas which have the greatest potential impact on users, so I'll be happy to upvote if you share a link below.
I think periodically updating a table with the newest blog ids is a great idea. If I store the latest visit data, CTA CTR data and sources data for each blog post, I will be able to use fewer operations when creating further automations regarding the Inbound blog in the future.
I'm fairly new to all of this so do I really appreciate the help
It looks like you're trying to use the HubSpot Analytics API to retrieve CTA click rate data for specific blog posts within a particular blog. Based on the information you've provided, it seems you're having trouble filtering the results to get data only for the desired blog . Here's how you might be able to achieve this:
Use Content Group ID: HubSpot uses Content Group IDs to group related content, such as blog posts. These IDs are used to filter data for specific blogs. You're on the right track with the /content-group/:blog_id part of the URL. However, you need to structure the URL correctly.
At this time, the public Analytics API endpoints are limited to reflecting the sources report, so they do not return CTA clicks like the report above. (Though I am seeing rawViews and ctaViews in our example JSON.)
That said, I was able to retrieve the analytics data for blog post 4011974019 by using the following request URL (using the blog post ID as as a page ID):
but just for blog posts in our Fire & Security Blog.
Currently that URL returns the analytics data for each individual blogs post in our Social Media Blog and our Fire & Security Blog - but the data doesn't tell me which Blog the blog post is part of.
This means I then have to do another check using the blog post IDs (https://api.hubapi.com/content/api/v2/blog-posts/BLOGPOSTID) to see whether each individual blog post is in the Social Media Blog or the Fire & Security Blog
As there are hundreds of blog posts in our Social Media Blog, it's using up too many of our operations in Integromat to do this, so I wanted to cut out the Social Media Blog from the initial request.
Thanks for your patience. I appreciate the added clarification.
Unfortunately, the Analytics API does not allow for such filtering at this time. I referenced our internal API catalog and confirmed that if you pass a blog's content-group ID in a request, it must be followed by /sources/.
While you currently can't exclude Social Media Blog posts from the request, there may be other ways to conserve operations.
Are you referencing this endoint for every blog post returned from /analytics/v2/reports/blog-posts/total?
If so, could you periodically update a table with all Fire & Security blog post IDs from this endpoint (using the content_group_id=1323969639 parameter) and use that to filter your results?
All this said, I definitely see the value in filtering this endpoint's non-sources results by blog, however. The team plans to release more flexible analytics endpoints in the future, but would you also mind posting a feature request describing your use case and pain here on the Ideas Forum? (I looked for similar existing ideas but found none.) Upvotes and comments help the product teams prioritize ideas which have the greatest potential impact on users, so I'll be happy to upvote if you share a link below.
I think periodically updating a table with the newest blog ids is a great idea. If I store the latest visit data, CTA CTR data and sources data for each blog post, I will be able to use fewer operations when creating further automations regarding the Inbound blog in the future.
I'm fairly new to all of this so do I really appreciate the help