Skip to content
Menu

Integrations

HubSpot, Salesforce and Mailchimp

BetaMarkdown version

Bring CRM and Mailchimp audience data into Herald as attributes and segments, optionally write results back to your CRM, and stop email to people who unsubscribed in Mailchimp.

Note

Built from each vendor's documented API and tested against local mocks; tell us if anything differs in your account.

These integrations pull from your CRM or audience every hour (or on Sync now) and only update people your app already sent Herald. Set them up in Settings → Integrations. An admin does it. Secrets are write-only and stored encrypted.

What you'll need

  • An admin of the account. Integrations are set up in Settings → Integrations.
  • HubSpot: a private app with crm.objects.contacts.read and crm.lists.read (plus the write scopes for write-back).
  • Salesforce: a connected app with the client credentials flow and a run-as user that can read Contacts or Leads (and edit them for write-back).
  • Mailchimp: an API key and the audience id.

How matching works

A CRM or Mailchimp record never creates a person. It updates someone the app already sent Herald, in the same app.

  • HubSpot and Salesforce match by an id property first (config idProperty: a person whose user id equals its value), then by email (case-insensitive, against the person's email). HubSpot's idProperty defaults to herald_user_id. Salesforce has no default, so without one it matches by email only.
  • Mailchimp matches by email, case-insensitive, against the person's email contact.

Records that match no one are counted as unmatched and never imported.

What syncs

  • Attributes. You choose up to 20 properties or fields (letters, digits and _, starting with a letter). Each lands on the matched person as hubspot_<name>, salesforce_<name> or mailchimp_<name>, lower case. An empty value removes the attribute. Nothing is copied by default.
  • Segments. HubSpot lists, Salesforce campaigns and Mailchimp tags (up to 10 each) become segments named "HubSpot: <list name>", "Salesforce: <campaign name>" and "Mailchimp: <tag>". Membership is replaced every run with the matched members.
  • First run. HubSpot and Salesforce read the last 7 days, then continue from where the last run stopped. A run that runs out of time continues next hour.

Write-back (HubSpot and Salesforce)

Off by default. When on, Herald writes four fields to the matched record for people with new decisions (first run: the last 24 hours): the latest agent, message (variant name), sent time and conversion time. Only values present are written. People without a matching record are skipped.

HubSpot property (group herald)Salesforce field
Last agentherald_last_agent (text)Herald_Last_Agent__c (Text 255)
Last messageherald_last_message (text)Herald_Last_Message__c (Text 255)
Last sent atherald_last_sent_at (datetime)Herald_Last_Sent_At__c (Date/Time)
Converted atherald_converted_at (datetime)Herald_Converted_At__c (Date/Time)

HubSpot

  1. In HubSpot, open Settings → Integrations → Private apps and create an app with the scopes crm.objects.contacts.read and crm.lists.read. For write-back also add crm.objects.contacts.write and crm.schemas.contacts.write.
  2. Paste its access token in the console.
  3. If your contacts have a property holding your app's user id, enter its internal name. Otherwise people are matched by email.
  4. Pick the properties and the list ids.

With write-back on, Test checks the token and creates the herald property group and the four properties when they are missing (safe to run again).

Common errors

MessageCauseFix
HubSpot: <message> or HubSpot answered HTTP <status>Shown as the last error: HubSpot refused a call, often a missing scope or an expired tokenCheck the token and its scopes
HubSpot rate limit reached; continuing next hourHubSpot's rate limitNone: the next hourly run continues
Out of time reading the list; it syncs next hourA large list didn't finish in one runNone: the next run continues
HubSpot request failedHubSpot couldn't be reachedNone: the next run retries

Salesforce

  1. In Salesforce Setup, create a connected app (or external client app) with OAuth, enable the client credentials flow and pick a run-as user with read access to Contacts or Leads (and edit access for write-back).
  2. Paste your My Domain URL, consumer key and consumer secret as { "instanceUrl": "https://<domain>.my.salesforce.com", "clientId": "…", "clientSecret": "…" }. The URL must be https on *.salesforce.com.
  3. Choose the object: Contact (default) or Lead. Pick the fields and the campaign ids.
  4. For write-back, create the four custom fields above on the object. With write-back on, Test describes the object and lists any that are missing.

Common errors

MessageCauseFix
Salesforce: <message> or Salesforce answered HTTP <status>Shown as the last error: Salesforce refused a call, often the integration user's permissionsCheck the user's object and field access
Salesforce: campaign <id> not found or Invalid campaign id <id>A campaign in lists doesn't exist or isn't an idFix the campaign id
object must be Contact or LeadSaving the integration: wrong objectChoose Contact or Lead
Salesforce request failedSalesforce couldn't be reachedNone: the next run retries

Mailchimp

  1. In Mailchimp, open Profile, Extras, API keys and create a key (it ends in a data center such as -us21).
  2. Paste it in the console with the audience id (Audience, Settings, Audience name and defaults).
  3. Pick the tags (up to 10) and the merge tags (up to 20, such as FNAME).

Unsubscribes. With the option Sync unsubscribes (on by default), a member who is unsubscribed or cleaned in Mailchimp gets an email suppression in Herald, so Herald stops emailing that address too. Herald never lifts a suppression, so a re-subscribe in Mailchimp does not unsuppress. Mailchimp never adds a person. Test reads the audience.

Common errors

MessageCauseFix
Mailchimp: <detail> or Mailchimp answered HTTP <status>Shown as the last error: Mailchimp refused a callCheck the API key and audience id
listId must be the audience idSaving the integration: not an audience idCopy the id from the audience's settings
mergeFields must be merge tags such as FNAMESaving the integration: a merge field isn't a tagUse the merge tags, not the labels
The API key is not set or unreadableThe secret is missingPaste the API key again

Troubleshooting

  • Records are unmatched. Check the id property, or that the person's email in Herald equals the CRM or Mailchimp email.
  • Write-back skips a person. No matching record in the CRM.
  • Salesforce Test lists missing fields. Create the four custom fields on the chosen object.

See Herald decide live →