You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> HubSpot's device-mode integration has two conditions for Identify to create or update a contact. Identify calls must include a `traits.email` value and need to accompany a Page or Track call. You can read more from HubSpot's documentation [here](https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor){:target="_blank"}. If you are using HubSpot's cloud-mode integration, an Identify call will update records without the need for a Page or Track call.
50
+
> HubSpot's device-mode integration has two conditions for Identify to create or update a contact. Identify calls must include a `traits.email` value and need to go with a Page or Track call. You can read more from HubSpot's documentation [here](https://developers.hubspot.com/docs/methods/tracking_code_api/identify_visitor){:target="_blank"}. If you are using HubSpot's cloud-mode integration, an Identify call will update records without the need for a Page or Track call.
51
51
52
52
HubSpot does not accept any trait keys that contain upper case letters or spaces. Segment converts any custom traits you send to lower case, and replaces spaces with an underscore.
53
53
54
-
Any traits that aren't contact fields in HubSpot are removed from the request. To find out which fields you can set, check out the custom field names in **Contacts > Contact Settings**. Example field names are "firstname", "lastname", "company", "phone", etc.
54
+
Hubspot removes from the request any traits that aren't contact fields in HubSpot. To find out which fields you can set, check out the custom field names in **Contacts > Contact Settings**. Example field names are `firstname`, `lastname`, `company`, and `phone`.
55
55
56
56
If you specify a company name (using `traits.company.name`), it appears as a *property* of the contact (you can find it in HubSpot's UI using **About [contact] > View > View All Properties**), but it does not appear as the user's company under **[contact]'s Company**.
57
57
58
-
The following traits are tagged as special fields in HubSpot:
58
+
Hubspot tags the following fields as special fields:
59
59
60
60
- address
61
61
- city
@@ -78,13 +78,14 @@ analytics.track("Clicked Buy Now button", {
78
78
})
79
79
```
80
80
81
-
**IMPORTANT:** You must have a HubSpot Enterprise account for traits from an Identify call to be passed through to your Track call and be successfully sent as [a custom event to HubSpot](https://knowledge.hubspot.com/events-user-guide-v2/using-custom-events).
81
+
> warning "Important"
82
+
> You must have a HubSpot Enterprise account for Segment to pass traits from an Identify call through to your Track call and send them as[custom events to HubSpot](https://knowledge.hubspot.com/events-user-guide-v2/using-custom-events).
82
83
83
84
The event will appear in your HubSpot UI but may take up to 60 minutes to appear in the graph visualization.
84
85
85
86
### Server
86
87
87
-
When calling from any of our server-side sources you must provide the contact's email as `properties.email` so that HubSpot can tie the event to the appropriate contact. An example call in Python would look like:
88
+
When calling from one of Segment's server-side sources, provide the contact's email as `properties.email` so that HubSpot can tie the event to the appropriate contact. An example call in Python would look like:
88
89
89
90
```python
90
91
analytics.track(
@@ -101,7 +102,7 @@ In this case, your HubSpot `eventId` is 'Bought Item'. If you want to use an exi
101
102
102
103
#### Setting Contact Properties on Track
103
104
104
-
Segment recommends that you send `traits` with an [Identify](/docs/connections/spec/identify/) call. You can also set HubSpot properties on a track call sent from any server-side source, as allowed by their[events API](http://developers.hubspot.com/docs/methods/enterprise_events/http_api){:target="_blank"}. You might want to use this method if you're running out of API calls on the Identify requests.
105
+
Segment recommends that you send `traits` with an [Identify](/docs/connections/spec/identify/) call. You can also set HubSpot properties on a track call sent from any server-side source, as allowed by Hubspot's[events API](http://developers.hubspot.com/docs/methods/enterprise_events/http_api){:target="_blank"}. You might want to use this method if you're running out of API calls on the Identify requests.
105
106
106
107
Include HubSpot contact properties into the `context.traits` object:
107
108
@@ -122,7 +123,8 @@ analytics.track(
122
123
123
124
## Group
124
125
125
-
__NOTE: Group calls are not compatible with our Analytics.js library.__
126
+
> info ""
127
+
> Group calls are not compatible with the Analytics.js library.
126
128
127
129
If you're not familiar with the Segment Specs, take a look to understand what the [Group method](/docs/connections/spec/group/) does. An example call would look like:
128
130
@@ -137,14 +139,14 @@ analytics.group({
137
139
});
138
140
```
139
141
140
-
Group calls map to the HubSpot [Companies API](https://developers.hubspot.com/docs/methods/companies/companies-overview){:target="_blank"}. Segment's integration is responsible for creating and updating company objects with whatever traits you set, as well as [associating individual contacts to a company](https://developers.hubspot.com/docs/methods/companies/add_contact_to_company){:target="_blank"}.
142
+
Group calls map to the HubSpot [Companies API](https://developers.hubspot.com/docs/methods/companies/companies-overview){:target="_blank"}. Segment's integration creates and updates company objects with whatever traits are set, and [associates individual contacts to a company](https://developers.hubspot.com/docs/methods/companies/add_contact_to_company){:target="_blank"}.
143
+
144
+
145
+
The three requirements to creating companies and associating contacts are:
141
146
142
-
> warning ""
143
-
> There are three requirements to creating companies and associating contacts:
144
-
>
145
-
>1. Group calls only take effect when called using server-side libraries or mobile libraries, not using our client-side javascript library.
146
-
>2. Your contact must have been identified and created within HubSpot (called using analytics.identify for this userId first).
147
-
>3. You must include a `website` trait in your group call, and it must be a full, valid, and complete URL. HubSpot uses the domain of the website trait as a unique identifier for companies. To create a new company you must use the full URL and not just the subdomain.
147
+
1. Group calls take effect when called using server-side libraries or mobile libraries, not the client-side javascript library.
148
+
2. Your contact must be identified and created within HubSpot (called using `analytics.identify` for this `userId first`).
149
+
3. You must include a `website` trait in your group call, and it must be a full, valid, and complete URL. HubSpot uses the domain of the website trait as a unique identifier for companies. To create a new company you must use the full URL and not just the subdomain.
148
150
149
151
Segment can send the following group traits to HubSpot as special properties:
150
152
@@ -164,7 +166,7 @@ Segment can send the following group traits to HubSpot as special properties:
164
166
165
167
### API Call Limits
166
168
167
-
HubSpot limits the total amount of hourly and daily requests we can make to their API on your behalf. Read more about these limits [here](https://developers.hubspot.com/apps/api_guidelines).
169
+
HubSpot limits the total amount of hourly and daily requests Segment can make to their API on your behalf. Read more about these limits [here](https://developers.hubspot.com/apps/api_guidelines){target="_blank"}.
168
170
169
171
HubSpot Plan: Free & Starter
170
172
* Maximum Number of API Calls per 10 Seconds, per Key or Token: **100**
@@ -181,9 +183,9 @@ HubSpot Plan: API Add-On (Any Tier)
181
183
182
184
### Sending Dates as Property Values
183
185
184
-
HubSpot's API has [specific requirements](http://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis) regarding how dates should be formatted before they are delivered as contact properties with date types.
186
+
HubSpot's API has [specific requirements](http://developers.hubspot.com/docs/faq/how-should-timestamps-be-formatted-for-hubspots-apis) regarding you to format dates before they deliver as contact properties with date types.
185
187
186
-
In order to ensure proper transformation of these properties, pass them to Segment as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted strings and **not** as UNIX timestamps. Here's a Javascript example:
188
+
To ensure proper transformation of these properties, pass them to Segment as [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) formatted strings and **not** as UNIX timestamps. Here's a Javascript example:
When using any of our server-side sources, our connector will infer`traits.lifecycle_stage` as `lifecyclestage`. If you're using a custom contact property for custom lifecycle stage's, you should give the property a distinct name, such as `custom_lifecycle_stage`.
198
+
When using any of Segment's server-side sources, a connector infers`traits.lifecycle_stage` as `lifecyclestage`. If you're using a custom contact property for custom lifecycle stage's, you should give the property a distinct name, such as `custom_lifecycle_stage`.
197
199
198
200
### Loading Forms SDK
199
201
200
-
Segment gives you the option to load the [HubSpot Forms SDK](https://developers.hubspot.com/docs/methods/forms/advanced_form_options) alongside their tracking library. This can be done by enabling the **Load Forms SDK** setting when configuring your HubSpot integration.
202
+
Segment gives you the option to load the [HubSpot Forms SDK](https://developers.hubspot.com/docs/methods/forms/advanced_form_options) alongside their tracking library. Enable the **Load Forms SDK** setting when you your HubSpot integration.
201
203
202
204
> info ""
203
-
> The Forms SDK expects to be loaded synchronously but analytics.js is loaded asynchronously. Therefore, in order to interact with the API, you need to run your code inside an [analytics.ready](/docs/connections/sources/catalog/libraries/website/javascript/#ready) callback. Here's an example:
205
+
> The Forms SDK expects to load synchronously but analytics.js loads asynchronously. To interact with the API, run code inside an [analytics.ready](/docs/connections/sources/catalog/libraries/website/javascript/#ready) callback. For example:
204
206
205
207
```js
206
208
analytics.ready(function(){
@@ -228,7 +230,7 @@ HubSpot requires that you create and define any custom traits in the HubSpot UI
228
230
229
231
### How it works: User-Level Traits and Audiences
230
232
231
-
Personas sends **User-Level data** to HubSpot to update properties on a user (or `contacts` in HubSpot) record, using an **Identify** call to add or update a standard `Property` or when a trait is computed, and a **Track** call when an audience is entered or exited.
233
+
Personas sends **User-Level data** to HubSpot to update properties on a user (or `contacts` in HubSpot) record, using an **Identify** call to add or update a standard `Property` or when Segment computes a trait, and a **Track** call when the user enters or exits an audience.
232
234
233
235
-**Computed Traits**: When the trait is first computed, Personas sends an **Identify** call to update the records of all users who are included in the computed trait. Each time the trait is computed after that, Personas sends a **Identify** call to HubSpot to update the values. For example, if a computed trait counts the number of times a user visits your pricing page, and the user visits your pricing page five times, Segment first sends an Identify call with the property `pricing_page_visits: 5`, then sends a Identify call when this number updates. This appears in HubSpot as a `Property` for the contact.
0 commit comments