APIs & Integrations

PowerMyAnalytic
Top Contributor

Analytics API get count of all contacts

SOLVE

Hi HubSpot,

 

I try to retrieve the count of all contacts by this request

https://api.hubapi.com/analytics/v2/reports/totals/total?start=19700101&end=20190923

trying to get lifetime data by using start date of 1970-01-01.

 

Its a try to mimic the result of "new Contacts" from Marketing Dashboard.

2019-09-24 17_28_15-Reports dashboard.png

 

But the numbers don't match,

via request: 216,558 contacts

via dashboard: 216,228 contacts (the correct one)

 

Portal ID: 4416406

 

Please investigate,

maybe there is easy way to get total contacts...

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Analytics API get count of all contacts

SOLVE

Hi @PowerMyAnalytic,

 

I hope all is well with you 😄

 

This endpoint here: Get analytics data breakdowns is designed around how sources report (Reports > Analytics Tools > Traffic Analytics) works. Learn more about sources report: Analyze data in the sources report and for now, there currently isn't an endpoint to retrieve the report in the report dashboard. 

 

That said, let me shed some lights here. The sources reporting and the new contact report (in your dashboard) works a little differently and this is because deleted contact will still show up in the sources report whereas for new contact report (in your dashboard) the number will decrease if the contact has been deleted. This explains why the number return from the request API endpoint is slightly higher than the one in the dashboard.

 

You can check this out by creating a report 'New contacts by source' in your report dashboard and maybe look at the 'Referral' sources:

  • In the dashboard, it is showing 198 and
  • In the sources report, it is showing 201

newcontactsreferral.png

And if you click into the 201, at around page 2, you'll see a deleted contact; this evidence that deleted contact will still show on sources analytics but not on new contacts report.

 

I hope this helps to clarify!

View solution in original post

0 Upvotes
2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Analytics API get count of all contacts

SOLVE

Hi @PowerMyAnalytic,

 

I hope all is well with you 😄

 

This endpoint here: Get analytics data breakdowns is designed around how sources report (Reports > Analytics Tools > Traffic Analytics) works. Learn more about sources report: Analyze data in the sources report and for now, there currently isn't an endpoint to retrieve the report in the report dashboard. 

 

That said, let me shed some lights here. The sources reporting and the new contact report (in your dashboard) works a little differently and this is because deleted contact will still show up in the sources report whereas for new contact report (in your dashboard) the number will decrease if the contact has been deleted. This explains why the number return from the request API endpoint is slightly higher than the one in the dashboard.

 

You can check this out by creating a report 'New contacts by source' in your report dashboard and maybe look at the 'Referral' sources:

  • In the dashboard, it is showing 198 and
  • In the sources report, it is showing 201

newcontactsreferral.png

And if you click into the 201, at around page 2, you'll see a deleted contact; this evidence that deleted contact will still show on sources analytics but not on new contacts report.

 

I hope this helps to clarify!

0 Upvotes
PowerMyAnalytic
Top Contributor

Analytics API get count of all contacts

SOLVE

Hi @WendyGoh,

 

Thanks for clarifying!

0 Upvotes