Visit our new documentation site! This documentation page is no longer updated.

Writing Job Results into HubSpot

You can write job results directly into your HubSpot Marketing Cloud from Treasure Data.

Table of Contents


  • Basic knowledge of Treasure Data, including the toolbelt.
  • A HubSpot account who can grant permissions to Treasure Data.


Visit Treasure Data console, go to query editor, and enter your query into the query editor. Click on Output results.

Choose saved connection

A dialog Choose Saved Connection will be displayed. Select an existing hubspot connection, as shown, or follow the next step on how to create a new connection within the Sources Catalog.

Create a new connection

Go to Treasure Data Connections search and select HubSpot. You will see the following dialog:

Select an existing OAuth connection for HubSpot, or click the link under OAuth connection to create a new one.

Create a new OAuth connection

Sign in to your HubSpot account in popup window

You will get a list of permissions that you need to grant access to. Click Grant Access.

You will be redirected back to the Treasure Data Connections page. Repeat the first step (Create a new connection) and choose your new OAuth connection, then finish creating your connection.

Now you can use the new hubspot connection in Choose Save Connection.

Additional configuration

After create new hubspot connection or select an existing one, you will see the Addtional configuration popup.

You need to select the HubSpot object for which data needs to be inserted.

Target Name

The HubSpot API supported objects such as Contacts, Contact Properties, Companies and Company Properties need to be specified in the following format as ‘target’ name.

HubSpot object Target Name Description
Contacts contacts Create group of contacts or update an existing one. Requires email column
Contact properties contact_properties Update group of contacts data. Requires email, name, value columns. Requires type, fieldType columns for new property. If the target Contact Properties is selected, you can turn feature Enable batch insert/update on/off.
Companies companies Create new company or update an existing one. Requires website column
Company properties company_properties Update group of companies data. Requires website, name, value columns. Requires type column for new property.

Enable batch insert/update

If the target Contact Properties is selected, you can turn feature bulk insert/update on. You don’t need to create contacts via target Contact. This option will create a group of contacts or update a group of contacts contacts exists. If you select this option, any errors with a single contact in your batch prevents the entire batch from processing. You also must turn on the setting Automatically create and associate companies with contacts from HubSpot portal to enable the contacts to automatically be associated with company.

If you turn off the bulk insert/update feature, you must create contacts via target Contacts first. Each company’s data will be created automatically, regardless if the setting Automatically create and associate companies with contacts from the HubSpot portal is on or off.

For more details, go to the Create or update a group of contacts page.

Basic usage

Write the query

Go to the Treasure Data Console query editor page and compile your query.

Execute the query

Finally, either save the query with a name and run or just run the query. UWhen the query completes successfully, the query result are automatically imported to the specified database destination.

Last modified: Jan 17 2018 19:13:15 UTC

If this article is incorrect or outdated, or omits critical information, let us know. For all other issues, access our support channels.