APIs & Integrations

AKarlsson1
Participant

Connect Marketing statistics with Contacts and Companies

Hi,

 

We have called endpoints for Marketing statistics (https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-email-statistics), All contacts (https://legacydocs.hubspot.com/docs/methods/contacts/get_contacts) and All companies (https://legacydocs.hubspot.com/docs/methods/companies/get-all-companies). 

 

We want to analyse marketing statistics on companies. How can we create a relationship between the tables through Contacs? I assume we need to get additional tables as well but which one/s? 

 

Do we need the contact list table/s?

https://legacydocs.hubspot.com/docs/methods/lists/contact-lists-overview 

 

Thanks in advance!

0 Upvotes
6 Replies 6
AKarlsson1
Participant

Connect Marketing statistics with Contacts and Companies

@dennisedson of course 🙂

Case

we want to analyze marketing email statistics (open rate, clik through, nr och recipiants etc) on companies. Companies-level is requires as we want to compare that granularity and statistics with data from other data sources on companies. 

 

What we started with

Endpoints for Marketing email statistics, All contacts and All companies

 

Challenges

Connecting marketing email statistics to contacts and companies.

You've helped me with the associations endpoint for contacts and companies https://developers.hubspot.com/docs/api/crm/associations 

But how do I link marketing statistics to (each) contacts?

 

Any other ideas on how we can achieve our goal with analyzing email statistics on companies?

 

Thank you so much for helping out.

dennisedson
HubSpot Product Team
HubSpot Product Team

Connect Marketing statistics with Contacts and Companies

@Josh ,

Can you think of a workflow that might make this easier?  Going out on a limb.  If not, we would need to hit the list api to get the contact ids then go to the associations.  Getting complicated quickly 😅

0 Upvotes
lynton
Contributor | Elite Partner
Contributor | Elite Partner

Connect Marketing statistics with Contacts and Companies

@dennisedson is correct, you need the associations api to link the contacts and companies together: https://developers.hubspot.com/docs/api/crm/associations

 

Let us know if you have any other questions!

 

AKarlsson1
Participant

Connect Marketing statistics with Contacts and Companies

@lynton @dennisedson thank you so much! Much appreciated.

 

Do I need this list as well to get each contact from a list from the email statistics table?

https://legacydocs.hubspot.com/docs/methods/lists/contact-lists-overview

Which of the endpoints do I need then?

 

 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Connect Marketing statistics with Contacts and Companies

@AKarlsson1 

I am not sure I fully understand.  Could you provide some more details?

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Connect Marketing statistics with Contacts and Companies

@AKarlsson1 ,

I would think you would also need to hit the associations api to see what company a contact is connected to.  Specifically, the batch read.  If you have the IDs of all of the contacts, you can hit that endpoint with their ids which would return all of the associated companies.  Not sure if you would need the get all companies endpoint, but that totally depends of what you are measuring.

@lynton , do you have any advice here?