Prerequisites
Recommended Integration
The Extole HubSpot App andhubspot_integration — an integration you configure in your Extole account — work together to provide advocate sync, referral tracking, and deal scoring.
Extole HubSpot App
Currently distributed as a private app. This section will be updated once it’s listed on the HubSpot Marketplace.
dealstage = closedwon, with Include associated contact data enabled so the event carries both the deal’s own properties (such as amount) and the contact’s identity and advocate code in one payload.
Manage Advocate Codes — Generates a JavaScript snippet for the client’s site. When a friend arrives via an advocate’s share link, the snippet reads the shareable code from the URL, persists it, and injects it as a URL query param on any page with a HubSpot form so the form’s hidden advocate_code field is pre-populated at submission. Requires HubSpot-native forms; doesn’t work with third-party form tools.
Manage Share Links — Automatically generates Extole share links for contacts and writes them to a configurable contact property, with auto-generation on contact create and bulk backfill for existing contacts. Includes Anonymous Advocate Sync: the reverse-direction webhook endpoint that Advocate Sync (below) sends requests to.
Advocate Sync
Two pieces work together to push advocate data into HubSpot:hubspot_integration— an integration in your Extole account that holds your HubSpot connection settings: the webhook URL and shared secret.hubspot_share_controller— a trigger you attach to each campaign, so it fires whenever that campaign’s advocate journey creates a share link.
Set it up:
-
In Security Center > Keys, create a Client Key (Type:
Webhook, Algorithm:Password) holding the shared secret from the app’s Anonymous Advocate Sync section. - In the integration’s Configuration tab, set Webhook URL to the app’s Anonymous Advocate Sync endpoint, and Shared Secret to reference that Client Key.
-
Duplicate the
hubspot_share_controllertrigger into each marketing campaign that should sync advocates: -
On the duplicated copy, set Journey Names to the campaign’s real advocate journey (for example,
ADVOCATE) and HubSpot Webhook to the integration’s Dispatch Webhook setting. Publish the campaign.
Legacy and Custom Setups
These are the setups Extole used for this integration before the HubSpot App existed. They’re kept here for accounts that already built things this way, or that need finer control over the HubSpot side than the App provides.Advocate Sync — Custom Endpoint
Use the samehubspot_share_controller trigger from Recommended Integration above, but pair it with a HubSpot endpoint you build yourself instead of the App’s Anonymous Advocate Sync endpoint.
-
Create the function:
-
Implement the handler to verify
shared_secretand upsert the contact via the HubSpot CRM API, using a Private App access token or Service Key (contacts read/write scope) added as a function secret. -
Upload it:
-
The resulting URL is
https://<account-id>.hs-sites-<region>.com/_hcms/api/<path>. Use this as the integration’s Webhook URL, as in the section above.
Advocate Sync — Direct API Calls
Extole calls HubSpot’s Contacts API directly, with no integration or trigger involved.- In your HubSpot developer account, create a private app with a
crm.objects.contacts.writescope and generate a Bearer Token. - In Extole’s Tech Center > Outbound Webhooks, create a Client Key: select Webhook as the Key Type, Password as the Algorithm, and paste the Bearer Token as the key value.
- Create a webhook: Type Generic, Client Key set to the key from step 2, API URL
api.hubapi.com/crm/v3/objects/contacts, method POST. - Attach the webhook to the point in your Extole campaign that fires when a share link is created — the advocate journey’s SHAREABLE event.
201 with a body resembling:
share_link and share_code properties.
Referral Tracking on Form Completion
If you’re using the Extole HubSpot App, Manage Advocate Codes already pre-fills
advocate_code on your forms, and Configure Events can fire the resulting event to Extole without a custom workflow webhook — see Extole HubSpot App above. The steps below build both by hand.- Add a custom field to the HubSpot contact record and lead form, with internal name
advocate_code. - Add Extole’s Core and Event JavaScript tags to the lead form to track referral attribution even when the friend doesn’t manually enter a code.
- In HubSpot, create a workflow that triggers a webhook every time a form is completed with
advocate_codepopulated, or the field is populated on a contact record. - Configure the workflow webhook: method POST, URL
api.extole.io/v5/events, authentication API Key (an Extole access token), with a customized request body:
Deal or Conversion Scoring
If you’re using the Extole HubSpot App, Configure Events already covers this — see the deal-based referral rewards example under Extole HubSpot App above. The steps below build the workflow webhook by hand.
converted, adding keys for product and amount to pass deal details. Configure a matching rule in the Extole campaign to reward the advocate once the criteria are met.
