APIs & Integrations

Fivetran
Participant

How to capture change in campaigns attached to a marketing email

SOLVE

I am trying to use the marketing email API to fetch data incrementally for our integration. We are fetching the latest data by filtering based on the updated field in the API parameters. However, we noticed that when a campaign is added to a marketing email the updated timestamp does not change.I am referring to the changes in the Internal HubSpot IDs as seen on the dashboard or allEmailCampaignIds field as seen in the marketing email API. This is causing us to have bad data being stored in our customers databases. Is there a way to identify when campaigns are added to marketing emails without iterating over all the records each time? Is it possible to find this information through this or any other APIs? 

0 Upvotes
1 Accepted solution
FTrands
Solution
Member

How to capture change in campaigns attached to a marketing email

SOLVE

To capture changes in campaigns attached to marketing emails using the HubSpot Marketing Email API, consider a practical approach that combines the Marketing Email API and the Engagement API. Start by setting up webhooks for engagements with the HubSpot Engagements API. These webhooks will notify your integration whenever there are changes in engagements related to marketing emails.

Monitor engagement events through the webhook notifications, specifically looking for additions or modifications of campaigns in emails. Extract relevant information from the payload, such as campaign IDs and email IDs, to identify the nature of the change. This real-time method allows your integration to promptly capture and respond to updates, preventing the storage of inaccurate data in customer databases.

Handle the webhook payloads in your endpoint to extract and process information about the specific engagement. Update your integration accordingly, ensuring that the changes in associated campaigns are accurately reflected. This method not only provides real-time updates but also allows you to fetch updated data based on the provided identifiers.

For added reliability, implement a fallback mechanism by periodically checking the Marketing Email API. This step serves as a secondary measure to cover any missed changes and to validate overall data integrity. Combining these strategies creates a practical solution that efficiently captures and manages changes in campaigns attached to marketing emails without the need for constant iteration over all records. If you have additional questions or need more detailed information on any specific aspect, feel free to ask.

View solution in original post

3 Replies 3
FTrands
Solution
Member

How to capture change in campaigns attached to a marketing email

SOLVE

To capture changes in campaigns attached to marketing emails using the HubSpot Marketing Email API, consider a practical approach that combines the Marketing Email API and the Engagement API. Start by setting up webhooks for engagements with the HubSpot Engagements API. These webhooks will notify your integration whenever there are changes in engagements related to marketing emails.

Monitor engagement events through the webhook notifications, specifically looking for additions or modifications of campaigns in emails. Extract relevant information from the payload, such as campaign IDs and email IDs, to identify the nature of the change. This real-time method allows your integration to promptly capture and respond to updates, preventing the storage of inaccurate data in customer databases.

Handle the webhook payloads in your endpoint to extract and process information about the specific engagement. Update your integration accordingly, ensuring that the changes in associated campaigns are accurately reflected. This method not only provides real-time updates but also allows you to fetch updated data based on the provided identifiers.

For added reliability, implement a fallback mechanism by periodically checking the Marketing Email API. This step serves as a secondary measure to cover any missed changes and to validate overall data integrity. Combining these strategies creates a practical solution that efficiently captures and manages changes in campaigns attached to marketing emails without the need for constant iteration over all records. If you have additional questions or need more detailed information on any specific aspect, feel free to ask.

Fivetran
Participant

How to capture change in campaigns attached to a marketing email

SOLVE

Thanks for the reply.
I am trying to test this on the API and I am not familiar with the hubspot application. Can you please guide me on how I can add a new Internal HubSpot ID to a marketing email so that I can test this? 
Also is it possible to remove an existing Internal HubSpot ID from a marketing email? If so, will that be captured in the webhook as well?

0 Upvotes
FTrands
Member

How to capture change in campaigns attached to a marketing email

SOLVE

For more relible solution 
For immediate action and further guidance, you can visit this link.

0 Upvotes