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:

  1. HubSpot Contacts (Leads) & Deals — Attribution tracks any stage change as events, additionally revenue is tracked on Closed Won Deals;
  2. HubSpot Landing Pages — Attribution automatically installs the tracking snippet on your HubSpot-hosted pages;
  3. HubSpot Forms — Attribution can automatically detect and track HubSpot Form submissions;
  4. 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 cases

The 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 supported

HubSpot 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: Created event
  • 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 Amount field is sent to Attribution as revenue

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:

SettingValue
MethodPOST
Webhook URLhttps://api.attributionapp.com/integrations/hubspot/workflow_webhook
Authentication typeAPI Key
API Key Nameatb_project_id
API Key ValueYour Attribution project identifier
API Key LocationQuery Parameters
Request bodyCustomize 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:

FieldRequiredDescription
contact_idYesHubSpot Contact ID
event_nameYesName of the event to create in Attribution (e.g. MQL Reached)
timestampRecommendedEvent timestamp — if omitted, the current time is used
Any other fieldsNoAdditional properties to attach to the event

For deal-based events:

FieldRequiredDescription
deal_idYesHubSpot Deal ID
property_nameNoThe deal property that changed (e.g. dealstage)
property_valueNoThe new value of the property
timestampRecommendedEvent timestamp
Any other fieldsNoAdditional properties to attach to the event

Testing

  1. Save the workflow and click Test Action in HubSpot
  2. In Attribution, go to Settings > Events Stream and click Start Live-Stream
  3. Switch back to HubSpot and click Test
  4. The HubSpot API should return ok
  5. The event should appear in the Attribution live stream within a minute or two
📘

This is an advanced feature

Custom 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:

  1. 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.
  2. 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.
  3. 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.