HubSpot
Attribution app has created a HubSpot connector that easily allows you to add Leads and Deal Stages (including Closed/Won) as conversion events, along with reported revenue.
If you use HubSpot, you can connect it to Attribution and automatically track Lead Lifecycle Stages, Deal Stage changes (with revenue) as conversions events which will help you built your Return on Ad Spend.
HubSpot is a multi-product platform which includes many components, Attribution has different level of integration with these components:
- HubSpot Contacts (Leads) & Deals — Attribution tracks any stage change as events, additionally revenue is tracked on Closed Won Deals;
- HubSpot Landing Pages — Attribution automatically installs the tracking snippet on your HubSpot-hosted pages;
- HubSpot Forms — Attribution can automatically detect and track HubSpot Form submissions;
- HubSpot Live Chat — Attribution can automatically track Leads captured from Live Chat as well as chat interactions as events.
Tracking snippet installation is required in most casesThe only scenario where manual installation is not needed is when your website is built entirely on HubSpot Landing Pages — Attribution installs the tracking snippet on those pages automatically.
In all other cases (your own website, WordPress, a custom site, etc.) you must install the Attribution tracking snippet manually. You also need to call
identify()with the email trait matching the HubSpot Contact email so Attribution can link anonymous visitors to HubSpot Contacts:Attribution.identify({ email: '[email protected]' });
Not all HubSpot products are supportedHubSpot products other than listed above are not supported. Before connecting the HubSpot integration, please review which modules in HubSpot you're using and whether they are covered by the Attribution integration.
For example, HubSpot Engagements (Calls, Emails, Meetings, Tasks) are not supported due to limitations in the HubSpot API.
HubSpot Contacts (Leads) & Deals & Revenue
Attribution listens for HubSpot webhooks and tracks the following contact and deal events automatically:
- Contact created — tracked as a
Contact: Createdevent - Lifecycle Stage change — tracked as
Lifecycle Stage: {value}(e.g.Lifecycle Stage: marketingqualifiedlead) - Lead Status change — tracked as
Lead Status: {value} - Contact merge — merged contacts are aliased so their history is preserved
- Deal Stage change — every stage transition is tracked as an event
- Closed Won revenue — when a Deal is marked as "closed won", the
Amountfield is sent to Attribution asrevenue
The integration supports customization — additional HubSpot Contact and Deal properties can be included in tracked events.
HubSpot Landing Pages
If your website is built on HubSpot Landing Pages, Attribution will automatically install its tracking snippet on your pages — no manual setup is required.
After you connect the integration, Attribution scans all your published HubSpot pages and injects the tracking snippet into each page's <head> section. This scan runs periodically, so any new pages you publish will be picked up automatically. Pages that are in draft or archived are skipped.
HubSpot Forms
Attribution can automatically detect and track HubSpot Form submissions as conversion events. Forms are tracked automatically when used on HubSpot Landing Pages.
If you use HubSpot Forms on a website that is not hosted by HubSpot, you will need to enable HubSpot tracking in the snippet load() method:
Attribution.load("ATTRIBUTION_PROJECT_ID", { atbIntegrations: { hubspot: { load: true } } });HubSpot Live Chat
Attribution can automatically track Leads captured from HubSpot Live Chat as well as chat interactions as events. Like Forms, Live Chat is tracked automatically on HubSpot Landing Pages. On non-HubSpot websites, enable it via the same snippet option shown above.
Advanced: Custom Workflow Webhooks
Attribution exposes a webhook endpoint that you can call from HubSpot Workflows. This lets you send custom conversion events to Attribution whenever a workflow is triggered — for example when a contact reaches a specific lifecycle stage or a deal moves to a custom pipeline stage that isn't tracked by the standard integration.
Setting Up a Workflow Action
In HubSpot, create or edit a workflow and add a Webhook action with the following configuration:
| Setting | Value |
|---|---|
| Method | POST |
| Webhook URL | https://api.attributionapp.com/integrations/hubspot/workflow_webhook |
| Authentication type | API Key |
| API Key Name | atb_project_id |
| API Key Value | Your Attribution project identifier |
| API Key Location | Query Parameters |
| Request body | Customize request body (see below) |
Request Body
The request body must include either contact_id or deal_id to identify the HubSpot record.
For contact-based events:
| Field | Required | Description |
|---|---|---|
contact_id | Yes | HubSpot Contact ID |
event_name | Yes | Name of the event to create in Attribution (e.g. MQL Reached) |
timestamp | Recommended | Event timestamp — if omitted, the current time is used |
| Any other fields | No | Additional properties to attach to the event |
For deal-based events:
| Field | Required | Description |
|---|---|---|
deal_id | Yes | HubSpot Deal ID |
property_name | No | The deal property that changed (e.g. dealstage) |
property_value | No | The new value of the property |
timestamp | Recommended | Event timestamp |
| Any other fields | No | Additional properties to attach to the event |
Testing
- Save the workflow and click Test Action in HubSpot
- In Attribution, go to Settings > Events Stream and click Start Live-Stream
- Switch back to HubSpot and click Test
- The HubSpot API should return
ok - The event should appear in the Attribution live stream within a minute or two
This is an advanced featureCustom workflow webhooks require manual configuration in HubSpot and a project identifier from Attribution support. The standard HubSpot integration (Contacts, Deals, Forms, Live Chat) does not require any of this — it works automatically once connected.
Troubleshooting "Unknown Source"
A common case when connecting HubSpot Integration. You will see that many (or sometimes all) of your HubSpot events will end up filtered as "Unknown Source" - this might happen due to number of reasons, most common being:
identify()call is not setup correctly and your are not identifying you visitors with email trait before they are created as Contacts in HubSpot, this leads to a condition when Attribution can't map anonymous visitor on a website to a Contact in HubSpot.- HubSpot Contact was created manually - if this is the case Attribution would not be able to know if these visitors ever been on your website and as result there is no channel to filter events from these Contacts.
- Deals from Contacts that been created before Attribution Integration was connected. These are common for renewal Deals as well. e.g. your existing user base which wasn't previously tracked by Attribution.
Most of the cases above are possible to solve, please don't hesitate to contact [email protected] to workout a solution for you.
Updated 11 days ago
