HubSpot is a leading marketing and sales platform that helps you track leads as well as inbound marketing and sales.

RudderStack supports HubSpot as a destination where you can seamlessly send your event data.

This HubSpot source uses the legacy API and will be deprecated soon. Refer to the HubSpot V2 guide for the latest documentation.
Find the open source transformer code for this destination in the GitHub repository.

Getting started

Before configuring HubSpot as a destination in RudderStack, verify if the source platform is supported by HubSpot by referring to the table below:

Connection ModeWebMobileServer
Device modeSupported--
Cloud modeSupportedSupportedSupported
To know more about the difference between cloud mode and device mode in RudderStack, refer to the RudderStack Connection Modes guide.

Once you have confirmed that the source platform supports sending events to HubSpot, follow these steps:

  1. From your RudderStack dashboard, add the source. Then, from the list of destinations, select HubSpot.
  2. Assign a name to the destination and click on Continue.

Connection settings

To successfully configure HubSpot as a destination using the legacy API, you can choose any of the two authorization types explained below:

Private Apps authorization type

The Private Apps authorization type allows you to use HubSpot's APIs to access specific data from your HubSpot account.

HubSpot connection settings
  • Access Token: Enter your HubSpot access token from the Private Apps section in the HubSpot dashboard.
Refer to the FAQ section to know where to get the HubSpot access token.
  • API Version: Select Legacy API from the dropdown. To work with the new HubSpot API, refer to the HubSpot V2 guide.

API Key authorization type

The API Key (deprecating soon) authorization type allows you to create custom applications using HubSpot's APIs.

This authorization type will be deprecated soon. Refer to HubSpot documentation for more information.
HubSpot connection settings
  • Hub ID: Enter your HubSpot Hub ID.
  • API Key: Enter your HubSpot API key. This field is mandatory to send data to HubSpot via the RudderStack cloud mode.
Refer to the FAQ section for more information on obtaining the Hub ID and API Key.
  • API Version: Select Legacy API from the dropdown. To work with the new HubSpot API, refer to the HubSpot V2 guide.

Client-side events filtering

HubSpot connection settings
These settings are applicable only if you're sending events to HubSpot via the web device mode. Refer to the Client-side Event Filtering guide for more information on this feature.

Page

The page call lets you record your website's page views with any additional relevant information about the viewed page.

RudderStack does not support sending the page calls to HubSpot via the cloud mode.
To send the data to HubSpot, an initial page call is required. For more information on the page call, refer to our RudderStack Events Specification documentation.

Identify

RudderStack sends the identify call to create or update a contact in HubSpot. The user's email ID must be present in the identify call's traits.

In the cloud mode, the identify call will create or update a contact in HubSpot. You are not required to call page or track later in order to create the contact.
In the device mode, you must call either page or track after the identify call to create a contact. The previously made page and track calls will automatically be associated with that contact once they are identified.

A sample identify call is as shown:

rudderanalytics.identify({
firstName: "Alex",
city: "New Orleans",
country: "USA",
phone: "+1-202-555-0146",
email: "alex@example.com",
custom_flavor: "chocolate",
custom_date: 1574769933368,
custom_date1: new Date("2019-10-14T11:15:53.296Z"),
})

Special fields

HubSpot supports the following traits as special fields:

  • address
  • city
  • companyName
  • email
  • firstName
  • lastName
  • position
  • phone
  • zip

Custom properties

RudderStack supports sending custom properties to HubSpot via the identify call. These properties will update the contact property you have already created in HubSpot, as shown:

HubSpot create property
Refer to the HubSpot Knowledge Base for more information on creating custom properties.

When you provide any custom property in the event, RudderStack automatically converts the field name into the lower case and replaces any space with an underscore. This is because HubSpot does not accept properties in the upper case and spaces.

RudderStack then maps the field values present in the traits to the corresponding HubSpot custom property.

HubSpot discards any property that does not exist and returns a 400 Bad Request error.

Dates

For sending properties of type date, send them as the epoch time or as a date object. RudderStack will convert it to the required HubSpot format (midnight UTC).

Track

A track call lets you record various user actions and any properties associated with them.

To associate a track call with a user, you need to specify the user's email under context.traits . Additionally, RudderStack associates the track events with the same user after an identify request is successfully made.

A sample track event is as shown:

rudderanalytics.track(
"Order Completed", {
value: 30,
}, {
context: {
traits: {
firstname: "Alex",
city: "New Orleans",
country: "USA",
phone: "+1-202-555-0146",
email: "alex@example.com",
},
},
}
)

The track call also supports externalId as a parameter which is mapped from externalID hubspotId.

Revenue events

For the revenue events, a value or revenue key should be included in the event properties to be recorded in HubSpot.

Screen

The screen call lets you record whenever your user views their mobile screen, with any additional information about the viewed screen.

If you have enabled screen views in your Android or iOS app implementation, RudderStack will send this information to HubSpot.

RudderStack also forwards the properties you've passed along with the screen call without any changes.

A sample screen call sent via the iOS SDK is shown below:

[[RSClient sharedInstance] screen:@"Main"
properties:@{@"prop_key" : @"prop_value"}];

FAQ

Where do I get the API Key and Hub ID for HubSpot?

Refer to the following HubSpot guides to get the API Key and Hub ID:

Where do I get the Access Token for HubSpot?

To get the Access Token:

  1. Log into your HubSpot account.
  2. Go to Integrations > Private Apps from the left sidebar.
  3. Click on your app to see the below:
Hubspot access token

Can I use HubSpot website analytics?

Yes - RudderStack supports sending page calls in device mode which can be used for HubSpot website analytics.


Contact us

For more information on the topics covered on this page, email us or start a conversation in our Slack community.