APIs & Integrations

RomanL
Member

Website analytics metrics

Dear all 

I want to set up a reporting using website metrics. I need some metrics. I am looking into the analytics-API (e.g.: https://api.hubapi.com/analytics/v2/reports/totals/summarize/weekly?start=20220101&end=20220109) and it seems to me that it covers some of the metrics I'll need:

- unique visitors: visitors 

- number of sessions: visits

- pages per sessions: pageviewsPersSession

However, I was not able to find information for average session duration as well as bounce rate. I have not been able to figure out how do get those as it does not seem possible to add properties (which is the case for v3 of the companies-endpoint). It seems that I can get the bounce rate as well as session duration via the reporting-api (https://api.hubapi.com/analytics/v2/reports/pages/total?start=20120102&end=20220108).

However, there are two problems with this approach:

1. Via the latter API I get loads of information I do not need. Does anyone know how I can get rid of the breakdown by pages so that it still shows me bounce rate and session duration (it does not work with v2/reports/totals/total as these two metrics disappear). 

2. The analytics-API above has the advantage that I can summarize data to weekly, monthly etc. and thus it would be perfect if this could also be done for session duration and bounce rate.

Thanks in advance!

0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Website analytics metrics

Hey, @RomanL 👋 I think you're on the right path here.

 

What you are describing is due to these endpoints not having the level of granularity you are wanting. You'll likely need to use programming logic to filter and reformat this data, outside the API call, to fit your needs. 

 

Best,

Jaycee

 

 

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
RomanL
Member

Website analytics metrics

Hi @Jaycee_Lewis 

Thank you for your answer. 

As I am a data analyst, I am not familiar with programming logic etc. and what is possible in Hubspot. 

Is there any way this information can be "calculated" in Hubspot so that I can get it via an API call?

 

Thanks in advance!

0 Upvotes