Overview

HubSpot is a CRM platform that provides tools for social media marketing, content management, web analytics, landing pages, customer support, and search engine optimization. It features integrations with many other MarTech platforms.

Integrating Lytics with HubSpot enables you to use your Lytics powered audiences in HubSpot.

Authorization

If you haven't already done so, you will need to set up a HubSpot account before you begin the process described below.

If you are new to creating authorizations in Lytics, see the Authorizations documentation for more information.

  1. Select HubSpot from the list of providers.
  2. Select the HubSpot Sign-In method for authorization.
  3. Login to HubSpot in the login popup.
  4. Select the HubSpot account you want to connect within the login popup.
  5. Grant the Lytics app permission to access your account in the login popup.
  6. In the Label text box, enter a name for the authorization in Lytics.
  7. (optional) In the Description text box, enter a description for this authorization in Lytics.
  8. Click Save Authorization.

Export Audiences

Keep your HubSpot email lists up to date with your Lytics audiences. Update and add properties from Lytics to HubSpot.

Integration Details

  • Implementation Type: Server-side Integration
  • Implementation Technique: REST API Integration - Audience Trigger Integration.
  • Frequency: Real-time Integration.
  • Resulting data: Contacts will be created or updated when they enter or exit the audience. User properties may be created if they are selected for export but do not exist in HubSpot.

This integration utilizes the Hubspot APIs to send user data. Once the export is started the job will:

  1. Check if the Lytics property group exists, and create the Lytics property group if it does not exist.
  2. Check if the selected properties exists in HubSpot. For the properties that do not exist, they will be created under the Lytics property group.
  3. Check if the selected list exists in HubSpot, if not create it. For dynamic lists, the filter will be ly_audiences CONTAINS the exported audience's slug.
  4. Create Batches of up to 100 users.
  5. Create/update the batch of contacts in HubSpot.
  6. If the list is static, add the batch of contacts to the List.
  7. As users enter the audience steps 3-5 will be repeated for them. The batch will fill for 5 min or until it reaches 100 users, whichever happens first.
  8. If users exit the audience they will also be added to a batch and updated in HubSpot like users entering the audience (steps 3-4). If the list is static, they will be removed from the list after being updated.

Fields

By default, Lytics exports the following fields to HubSpot:

Lytics User FieldDescriptionHubSpot FieldType
emailEmail AddressEmailstring
-comma separated list of audience slugsly_audiencesstring

Configuration

Follow these steps to set up and configure an export job for HubSpot in the Lytics platform. If you are new to creating jobs in Lytics, see the Destinations documentation for more information.

  1. Select HubSpot from the list of providers.
  2. Select the Export Audiences job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Select the audience to export.
  7. Complete the configuration steps for your job.
  8. (optional) From the List input, select the list to export to. If left blank or Create new list is selected, a new list will be created using the audience's slug as the name. The list's name can be changed while the export job is running.
  9. (optional) Select the Dynamic checkbox, to set if the list is/should be Dynamic (active). Note: if you have selected an existing dynamic list, exported users will only enter the list if they match the list's filter, Lytics will not force users to match the list's filter.
  10. (optional) From the Email Field input, select the Lytics field that contains an email. Either Email or Vid field must be set.
  11. (optional) From the Vid Field input, select the lytics field that contains a vid. Either Email or Vid field must be set.
  12. (optional) From the Map Fields input, select the Lytics field on the left, and its HubSpot destination on the right.
  13. (optional) From the Fields to Create input, select a list of user fields to create in HubSpot. All properties will be created under the Lytics property group.
  14. (optional) Select the Include Lytics Audience Membership checkbox, to include the user's audience membership as a property called ly_audiences. All properties will be created under the Lytics property group. Dynamic lists will do this regardless of this field.
  15. Click Start Export.

Import Contacts and Activity

Import contacts and email activity from HubSpot to drive better engagement through Lytics.

Integration Details

  • Implementation Type: Server-side Integration.
  • Implementation Technique: REST API Integration.
  • Frequency: Batch Integration.
  • Resulting data: User Profiles, Raw Event Data.

If contacts are selected to be imported the following will be repeated until all contacts have been processed:

  1. A page of contacts will be requested from hubspot
  2. Any contacts that haven't been modified since Import Contacts Since date will be filtered out.
  3. The contacts will be ingested into Lytics profiles

If events are selected to be imported the following will be repeated until all email events have been processed:

  1. A page of email events will be requested from hubspot that have occurred after Import Email Events Since.
  2. The email events will be ingested into activity on Lytics profiles

Fields

The following fields are included in the default mapping of the hubspot_contacts stream:

Source FieldLytics User FieldDescriptionType
email(identity-profiles[0].identities[1].value)IF eq(identity-profiles[0].identities[0].type, "EMAIL")email unique idEmail Addressstring
properties.firstname.valuefirst_nameFirst Namestring
properties.lastname.valuelast_nameLast Namestring
vidhs_vid unique idhubspot Vidstring

The following fields are included in the default mapping of the hubspot_activity stream:

Source FieldConditionalLytics User FieldDescriptionType
count(type)IF eq(type, "BOUNCE")hs_bounce_ctHubspot Hard Bounce Countint
count(type)IF eq(type, "CLICK")hs_click_ctHubspot Click Countint
count(type)IF eq(type, "OPEN")hs_open_ctHubspot OPEN Countint
count(type)IF eq(type, "SENT")hs_send_ctHubspot Send Countint
count(type)IF eq(type, "SPAMREPORT")hs_spam_report_ctHubspot Soft Bounce Countint
durationIF eq(type, "OPEN")hs_open_durationHubspot OPENs Durationstring
email(recipient)email unique idEmail Addressstring
epochms()IF eq(type, "SENT")hs_send_tsHubspot Last Send Timedate
max(epochms())IF eq(type, "BOUNCE")hs_last_bounce_tsHubspot Last Hard Bouncedate
max(epochms())IF eq(type, "CLICK")hs_last_click_tsHubspot Last Clickdate
max(epochms())IF eq(type, "OPEN")hs_last_open_tsHubspot Last OPENdate
max(epochms())IF eq(type, "SPAMREPORT")hs_last_spam_report_tsHubspot Last Soft Bouncedate
max(epochms())IF eq(type, "OPEN")last_active_tsLast Activedate
min(epochms())IF eq(type, "BOUNCE")hs_first_bounce_tsHubspot First Hard Bouncedate
min(epochms())IF eq(type, "CLICK")hs_first_click_tsHubspot First Clickdate
min(epochms())IF eq(type, "OPEN")hs_first_open_tsHubspot First OPENdate
min(epochms())IF eq(type, "SPAMREPORT")hs_first_spam_report_tsHubspot First Soft Bouncedate
urlmain(url)IF eq(type, "CLICK")hs_email_urlHubspot URLstring
valuect(hash(urlmain(url)))IF eq(type, "CLICK")hashedurlsHashed Urls Visitedmap[string]intsum
valuect(hourofday())IF eq(type, "OPEN")hs_hourly_openHubspot Hourly typesmap[string]intsum
valuect(hourofweek())IF eq(type, "OPEN")hs_hour_of_weekHubspot Hour of Week typesmap[string]intsum
valuect(type)hs_email_typeHubspot Email typesmap[string]intsum
valuect(yymm())IF eq(type, "OPEN")hs_monthlyHubspot OPENs By Monthmap[string]intsum

Configuration

Follow these steps to set up and configure an import job for HubSpot in the Lytics platform. If you are new to creating jobs in Lytics, see the Data Sources documentation for more information.

  1. Select HubSpot from the list of providers.
  2. Select the import job type from the list.
  3. Select the Authorization you would like to use or create a new one.
  4. Enter a Label to identify this job you are creating in Lytics.
  5. (Optional) Enter a Description for further context on your job.
  6. Complete the configuration steps for your job.
    hubspot-import-config
  7. (optional) Select the Import Contacts checkbox, to import contacts from Hubspot into Lytics.
  8. (optional) In the Import Contacts Since text box, enter the date to import contacts from Hubspot that have been modified after this date; yyyy-mm-dd HH:MM:SS format. If left blank, all contacts will be imported.
  9. (optional) Select the Import Email Events checkbox, to import email events from Hubspot into Lytics.
  10. (optional) In the Import Email Events Since text box, enter the date to import email events from Hubspot that have occurred after this date; yyyy-mm-dd HH:MM:SS format. If left blank, all email events will be imported.
  11. (optional) From the Properties multi-select, select the contact properties to import. If left blank, only basic properties will be imported.
  12. (optional) Select the Keep Updated checkbox, to continuously import from Hubspot.
  13. (Optional) Toggle Show Advanced Options.
  14. (optional) From the Import Frequency input, select how often a repeated import should run.
  15. (optional) From the Time of Day input, select the time of day to start the import, ignore for hourly imports.
  16. (optional) From the Timezone input, select the timezone for time of day.
  17. Click the Start job button to start the job