Events JavaScript API

Last updated July 11, 2019

_hsq.push(["trackEvent", { {event details} }]);

Please note: Events will only be processed for accounts with the enterprise edition of Marketing Hub, Sales Hub, or Service Hub.

Track an event. Events are activities that happen on your website, tracked through the HubSpot analytics system. You can use events to track specific activities completed by visitors on your site.  Tracked events can show up in the timeline of your contacts.


Arguments How to use Description
Event ID id: The ID of the event. If you created the event in HubSpot, use the generated ID of the event as a string. Otherwise, you can use a string name for the event to dynamically create an event. See the overview for more details on names and ids.
Value value: The value of the event. This is an optional argument that can be used to track the revenue of an event. This value will be used to increment the hs_analytics_revenue property if the event is associated with a contact record.