Custom events allow you to track advanced activity via a JavaScript or HTTP API. The Events API can be used to get details about your events.
POST
request to https://api.hubspot.com/events/v3/send
with your event data in the request body. Before sending event data, review the limits below, as exceeding these limits will result in an error.
Parameter | Type | Description |
---|---|---|
eventName | String | The internal name of the event. You can find this by querying your existing event definitions or within the HubSpot app. |
objectId | String | The ID of the CRM record that the event will be associated with. For contacts, you can alternatively use the email or utk field to identify the contact by email address or HubSpot usertoken. All other object types require objectId , unless a custom matching ID is defined for the event. If a customMatchingId is defined for the event, HubSpot will automatically set or override the objectId based on the configured mapping. Learn more in the custom event definitions guide. |
occurredAt | String | By default, HubSpot will set the event completion timestamp to the time that the request is sent. To specify the time of event completion, include a timestamp in an occurredAt field in the POST request body (ISO 8601 format). This can be especially helpful for backdating event data to more accurately reflect real-life event completion. |
properties | Object | The event properties to send data to. This can include HubSpot’s default event properties or any custom properties you’ve defined for the event. Most default event properties are string properties, but you can review all event properties by either querying the event definition or navigating to the event in HubSpot. If a custom matching ID is set up for the event, you may omit the objectId . HubSpot will attempt to link the event with a CRM object by setting the objectId on the event based on the configured mapping. Learn more about event properties below. |
GET
request to /events/v3/events
.
eventType
parameter along with the internal event name (e.g., pe123456_custom_event
). You can retrieve all event types using the event analytics API.objectType
parameter along with either the objectId
or objectProperty.<property>
parameters. The objectType
should specify the type of CRM object (e.g., contact
), while the other parameters specify the unique identifier value for the object (either record ID or a unique identifier property value). For contacts, you can use email
as a unique identifier property./events/v3/events?objectType=contact&objectId=111111
.
Alternatively, you can use the contact’s email address:
/events/v3/events?objectType=contacts&objectProperty.email=bilbo@shire.com
To filter the results by event completions with a specific event property value, you can include the property.<propertyName>
parameter. For example, to retrieve page visit events for your homepage, your request URL might be:
/events/v3/events?eventType=e_visited_page&property.hs_page_title=home
%20
or +
.
For example: property.hs_page_title=home+page
.properties
object with key-value pairs for the properties you want to update along with the property values to store.
Property type | Description |
---|---|
bool | A boolean value, either true or false . |
enumeration | A string representing a set of options. When sending multiple values, separate them with a semicolon. In HubSpot, this type corresponds to dropdown select, radio select, and multiple checkbox properties. |
date | A value representing a specific day, month, and year. Values must be represented in UTC time and can be formatted as ISO 8601 strings or EPOCH-timestamps in milliseconds (i.e. midnight UTC). |
datetime | A timestamp representing a specific day, month, year, and time of day. Values must be represented in UTC time and can be formatted as ISO 8601 strings or UNIX-timestamps in milliseconds. |
number | A number value containing numeric digits and at most one decimal. In HubSpot, this type corresponds to number and calculation properties. |
string | A plain text string limited to 65,536 characters. In HubSpot, this type corresponds to single-line and multi-line text properties. |
hs_page_content_type
property in the request body. For example:
hs_asset_type
property. If both hs_page_content_type
and hs_asset_type
are included in one request, hs_page_content_type
will override the hs_asset_type
value.Value | Description |
---|---|
STANDARD_PAGE | An interaction with a website page. |
LANDING_PAGE | An interaction with a landing page. |
BLOG_POST | An interaction with a blog post. |
KNOWLEDGE_ARTICLE | An interaction with a knowledge base article. |
Value | Description |
---|---|
AD | An interaction with an ad, such as a Facebook or Google ad. |
CALL | An interaction with a call. |
CONTACT_IMPORT | An interaction via a contact import. |
CONVERSATION | An interaction related to a HubSpot conversation. |
CUSTOM_BEHAVIORAL_EVENT_NAME | The internal name of a custom event, such as pe123456_manually_tracked_event . |
EMAIL | An interaction with an email. |
EXTERNAL_PAGE | An interaction with an external page. |
INTEGRATIONS | An interaction via an integration. |
MARKETING_EVENT | An interaction with a marketing event. |
MEDIA_BRIDGE | An interaction via the media bridge. |
MEETING | An interaction with a meeting. |
SALES_EMAIL | An interaction with a 1:1 sales email. |
SEQUENCE | An interaction with a sequence. |
SOCIAL_POST | An interaction with a social media post. |
OTHER | An interaction with an asset not in one of the above categories. |
hs_page_title
or hs_asset_title
property in your request with the name of the asset formatted as a string. For example:
hs_page_title:
hs_touchpoint_source
property in your request with one of the following values:
Value | Description |
---|---|
CONVERSATION | The interaction source is a conversation. |
DIRECT_TRAFFIC | The interaction source is direct traffic. |
EMAIL_MARKETING | The interaction source is a marketing email. |
HUBSPOT_CRM | The interaction source is the HubSpot CRM. |
INTEGRATION | The interaction source is an integration. |
MARKETING_EVENT | The interaction source is a marketing event. |
OFFLINE | The interaction source is offline. |
ORGANIC_SEARCH | The interaction source is organic search. |
OTHER_CAMPAIGNS | The interaction source is from an uncategorized campaign. |
PAID_SEARCH | The interaction source is a paid search ad. |
PAID_SOCIAL | The interaction source is a paid social ad. |
REFERRALS | The interaction source is a referral. |
SALES | The interaction source is sales. |
SOCIAL_MEDIA | The interaction source is social media (not a paid social ad). |