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.
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 Mode | Web | Mobile | Server |
---|---|---|---|
Device mode | Supported | - | - |
Cloud mode | Supported | Supported | Supported |
Once you have confirmed that the source platform supports sending events to HubSpot, follow these steps:
- From your RudderStack dashboard, add the source. Then, from the list of destinations, select HubSpot.
- Assign a name to the destination and click on Continue.
Connection settings
To successfully configure HubSpot as a destination, you'll need to configure the following settings:
- Hub ID: Enter your HubSpot Hub ID. For more information on obtaining the Hub ID, refer to the HubSpot support guide.
- API Key: Enter your HubSpot API key. For more information on obtaining the API key, refer to the HubSpot support guide.
Client-side events filtering
Web SDK settings
- Use device mode to send events: Enable this setting to send events via the device mode.
Page
The page
call lets you record your website's page views with any additional relevant information about the viewed page.
page
calls to HubSpot via the cloud mode.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
.
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.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: "Tintin", city: "Brussels", country: "Belgium", phone: "1234567890", email: "tintin@twentiethcentury.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:
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.
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( "Purchase", { value: 30, }, { context: { traits: { firstname: "Tintin", city: "Brussels", country: "Belgium", phone: "1234567890", email: "tintin@twentiethcentury.com", }, }, })
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"}];
HubSpot custom objects
RudderStack supports sending the HubSpot CRM custom object via the identify
call. It expects an object named hubspot
with the following properties:
contactId
qualifiedName
objects
objects
should be an array containing the objects with two properties - objectId
and objectType
. Also, contactId
is the ID of your HubSpot contact. RudderStack associates the contact with the objects you provide in the objects
array.
A sample identify
call for HubSpot CRM custom object is shown below:
rudderanalytics.identify("userId", { email: "name@domain.com", hubspot: { contactId: "512", qualifiedName: "p99688696_car", objects: [{ objectId: "32921360", objectType: "car", }, ], },})
FAQs
Where do I get the API Key and Hub ID for Hubspot?
You can get the API Key and Hub ID for Hubspot by logging into your Hubspot account.
Refer to the following HubSpot guides for more details:
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 queries on any of the sections covered in this guide, you can contact us or start a conversation in our Slack community.