This is a Jitsu.Classic documentation. For the lastest version, please visit docs.jitsu.com. Read about differences here.

πŸ“œ Configuration

Configuration UI

πŸ‘©β€πŸ”¬ Extending Jitsu

Overview
Destination Extensions
Source Extensions
API Specs

Jitsu Internals

Jitsu Server

HubSpot

Jitsu supports HubSpot as a destination.

HubSpot destination supports only stream

All incoming events are divided into 2 groups and sent to different HubSpot APIs:

  • Identification events (event_type field equal user_identify)
  • Other events

Identification events

Jitsu uses HubSpot Contacts API and sends createOrUpdate contact request to HubSpot with data (user properties) from /user or /eventn_ctx/user event JSON node depend on version of JS SDK. HubSpot supports default user properties like firstname, lastname, email, address, etc as well as custom user properties that are configured in HubSpot User Interface (About [contact] > View > View All Properties). You can manually set user properties in JS SDK id() call:

var user = loadUser() //load user from your application
jitsu.id({
  'firstname': user.firstname,
  'lastname': user.lastname,
  'email': user.email,
  'address': user.address,
  'company': user.company,
  'phone': user.phone,
  ...
})

or if you are using Jitsu Events API you should send event_type field with user_identify value and user JSON node that contains user properties:

{
  ...
  "event_type": "user_identify",
  "user": {
    "email": "customer@company.com",
    "firstname": "John",
    ...
  },
  ...
}

or you, also, could use JavaScript Transformations for deliver all user properties into user JSON node.

All fields that aren't in default HubSpot properties or that aren't configured in HubSpot User Interface will be deleted from request. You can find all user properties in Contacts > Contact Settings. HubSpot does not accept properties that contain spaces or uppercases. All properties will be converted to lowercase and all not alphanumeric symbols are replaced with underscores.

Other events

If you have a HubSpot Enterprise account you can track all other events like page views, conversions, etc. Jitsu sends them via HubSpot Events HTTP API. You can configure your own custom behavioral events in HubSpot User Interface or HubSpot will auto-create them for you based on event_type.

For using a certain custom behavioral event - specify its name in event_type field:

jitsu.track("custom_event_type", {
  conversion: {
    revenue: 2000.0,
    currency: "USD",
  },
});

Jitsu sends custom events to HubSpot with the following fields:

  • event_type from input event JSON / path
  • revenue from input event JSON / or /conversion/revenue path
  • all configured user properties from /user or /eventn_ctx/user path depend on version of JS SDK.

Other events are supported only on HubSpot Enterprise plan. /user/email is required.

Filtering events

For filtering events stream to prevent sending all events to HubSpot table_name_template is used. For more information see Table Names and Filters.

Configuration

HubSpot destination config consists of the following schema:

destinations:
  my_hubspot:
    type: hubspot
    mode: stream
    hubspot:
      access_token: "pat-abc-b7bc95dc-abcd-abcd-abcd-406aaa56c3cc" #Your HubSpot API Key - see below
      hub_id: "20546336" #Your Hub ID - see below
    data_layout:
      table_name_template: "{{text template}}" #Optional. It is used for filtering events.

HubSpot credentials

Field Type Description
access_token
(required)
string

HubSpot Private App Access Token. Read How to obtain Access Token. You need to enable following scopes for you private app: crm.objects.contacts.write crm.schemas.contacts.read

api_key
(deprecated)
string

Your HubSpot API Key. Deprecated in favor of Private App Access Token. Read How to migrate to Private App Access Token

hub_id
(required)
string

Your HubSpot Hub ID (in number format, like 453283). Read How to obtain HubSpot Hub ID