APIs & Integrations

Eugene_Teren
Member

how to get paid search marketing campaigns with reached contacts

Hi there,

 

Our client asked to pull data via API: paid search marketing campaigns (ID's and names) and properties of contacts that reached by campaigns.

 

The client showed the screenshot of how he built this report in UI. In chapter "Custom Report Builder" he selected "CRM | Contacts" primary data source and "Ad campaigns" option:

HVCU_HubSpot_Contacts_Marketing_Ad_Campaigns.jpg

 

I found how I can get a list of contacts with asked properties:

GET https://api.hubapi.com/crm/v3/objects/contacts?hapikey={{api_key}}&properties=business_loan_applicat...

 

But I faced a problem with how to get paid search marketing campaigns with reached contacts.

 

I'm a newbie in Hubspot API so please advise which API I should use to pull data of paid search marketing campaigns (ID's and names).

 

Best regards,

Eugene

0 Upvotes
6 Replies 6
lynton
Contributor | Elite Partner
Contributor | Elite Partner

how to get paid search marketing campaigns with reached contacts

@Eugene_Teren sorry for the late reply! This is the new web analytics api: https://developers.hubspot.com/docs/api/events/web-analytics

 

It returns web visits for each contact in HubSpot. However, you must pass the contact id to get the web analytics for each contact. For best efficiency, you can use the search api to filter contacts with recent website session data. Then you can request the web analytics by contact ID with a date filter to find recent traffic including UTM data. Unfortunately this is the only way I currently know to get this data you're looking for.

Eugene_Teren
Member

how to get paid search marketing campaigns with reached contacts

Hi @lynton !

 

Thank you for your advice.

Eugene_Teren
Member

how to get paid search marketing campaigns with reached contacts

Hi @lynton!

 

Thank you for the answer!

 

Do you mean Analytics API (https://legacydocs.hubspot.com/docs/methods/analytics/get-analytics-data-breakdowns)?

I tried to request analytics with breakdown_by = "utm-campaigns". The response contains a total count of reached contacts

(e.g., "contacts": 7) but not a list of contact id's that I need to link a campaign with contact's properties.
 
Also, I've read the "Web Analytics" chapter in Events API (https://developers.hubspot.com/docs/api/events/web-analytics) and got an example of data with parameter eventType=e_visited_page.
It seems like a promising way but I need to handle all of the contacts (pointing out contact_id as objectId) and I'm afraid of a limit issue.
 

Best regards,

Eugene

0 Upvotes
lynton
Contributor | Elite Partner
Contributor | Elite Partner

how to get paid search marketing campaigns with reached contacts

Hi Eugene,

 

Check out the Web Analytics API. This may help you identify web traffic by UTM variables associated with contacts. That's the best alternative I know of since there is no api for ad campaigns.

dennisedson
HubSpot Product Team
HubSpot Product Team

how to get paid search marketing campaigns with reached contacts

Hello @Eugene_Teren 

Welcome to the Community and to world of HubSpot APIs 😀

To the best of my knowledge, there is no API available for that 😥

This idea might be relevant to what you are needing and it looks like it is being worked on.

Although I am pretty sure about the above answer, I have been known to be wrong so will grab a few Community experts and ask them

@Phil_Vallender , @btsp , @lynton  would any of you be able to confirm my answer 🙏

 

0 Upvotes
Eugene_Teren
Member

how to get paid search marketing campaigns with reached contacts

Hi @dennisedson !

Thank you for the ideas! Sadly, it seems like not the case for my client.

 

Best regards,

Eugene

0 Upvotes