APIs & Integrations

LollipopRob
Colaborador(a)

List Blog Post analytics by Blog

resolver

Hi all

I'm trying to use the API to get the CTA click rate data for all blog posts in a particular blog of ours.

Using the analytics API documentation I've managed to get a list of ALL blog posts sorted by entrances and limited to 100 results.

https://api.hubapi.com/analytics/v2/reports/blog-posts/total?&start=20190101&end=20190228&sort=entra...

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:

analytics/v2/reports/:content_type/content-group/:blog_id/sources/:time_period

I've managed to get the sources report, but that's not much help. I need the visit and CTA clicks for each blog post.

I tried putting the blog ID into my URL:

https://api.hubapi.com/analytics/v2/reports/blog-posts/content-group/1323969639/total?&start=20190101&end=20190228&sort=entrances&limit=100

But this just returns a 404.

Does anybody know how to add a filter so that I only get data for the blog I need?

0 Avaliação positiva
2 Solução aceitas
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

List Blog Post analytics by Blog

resolver

Hi, @LollipopRob.

 

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.

Isaac Takushi

Associate Certification Manager

Exibir solução no post original

0 Avaliação positiva
LollipopRob
Solução
Colaborador(a)

List Blog Post analytics by Blog

resolver

Thanks Isaac, 

Here's the idea on the Ideas Forum: https://community.hubspot.com/t5/HubSpot-Ideas/Analytics-API-Get-Blog-Post-Data-by-Blog/idi-p/284517...

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

Thanks again

Exibir solução no post original

8 Respostas 8
hkyousufzai
Membro

List Blog Post analytics by Blog

resolver

If you facing some issues regarding MP3 Converter, then you can check from here. 

0 Avaliação positiva
dclark95
Membro

List Blog Post analytics by Blog

resolver

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:

  1. 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.

  2. Correct URL Structure: The correct URL structure for your case should be something like this:
    https://api.hubapi.com/analytics/v2/reports/blog-posts/content-group/:blog_id/total?start=20190101&e...

     

    Here's an example of what your API request URL might look like:

     

     

0 Avaliação positiva
hasasodfee
Membro

List Blog Post analytics by Blog

resolver

Can we use filter system in our normal blog to pick up the latest new or article on the top if the user want it? Kindly guide me regarding this. 

0 Avaliação positiva
IsaacTakushi
HubSpot Employee
HubSpot Employee

List Blog Post analytics by Blog

resolver

Hi, @LollipopRob.

 

It sounds like you're trying to pull the ViewsCTA Views, and CTA clicks metrics visible in the Website Analytics tool from this Analytics API endpoint. Is that correct?

 

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):

 

https://api.hubspot.com/analytics/v2/reports/blog-posts/4011974019/sources/total?start=20190101&end=20190228

Are you able to get results using that convention?

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva
LollipopRob
Colaborador(a)

List Blog Post analytics by Blog

resolver

Thanks for the reply Isaac

That URL does give some good data, I'm definitely going to use that.

However what I'm trying to achieve is getting the Blog Post analytics data from this URL:

https://api.hubapi.com/analytics/v2/reports/blog-posts/total?&start=20190101&end=20190228&sort=entra...

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.

Do you know if that's possible?

0 Avaliação positiva
IsaacTakushi
Solução
HubSpot Employee
HubSpot Employee

List Blog Post analytics by Blog

resolver

Hi, @LollipopRob.

 

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.

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva
LollipopRob
Solução
Colaborador(a)

List Blog Post analytics by Blog

resolver

Thanks Isaac, 

Here's the idea on the Ideas Forum: https://community.hubspot.com/t5/HubSpot-Ideas/Analytics-API-Get-Blog-Post-Data-by-Blog/idi-p/284517...

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

Thanks again

IsaacTakushi
HubSpot Employee
HubSpot Employee

List Blog Post analytics by Blog

resolver

Upvoted! Thanks for sharing, @LollipopRob.

 

I'm glad I could help.

Isaac Takushi

Associate Certification Manager
0 Avaliação positiva