Skip to main content

Documentation Index

Fetch the complete documentation index at: https://developers.hubspot.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Supported products

Track events in your HubSpot reports. Events can be tied to a contact record so that you can see if/when a contact triggered that event.

Usage

Track by Event ID

var _hsq = (window._hsq = window._hsq || []);
_hsq.push([
  "trackEvent",
  {
    id: "000000001625",
    value: 100,
  },
]);

Track by Event Name

var _hsq = (window._hsq = window._hsq || []);
_hsq.push([
  "trackEvent",
  {
    id: "custom_event_name",
    property1: "value1",
    property2: "value2",
  },
]);

Event IDs vs Names

  • Event ID: Use numerical IDs for events created in HubSpot.
  • Event Name: Use string names to dynamically create new events. If an event with that name doesn’t exist, it will be created automatically.
Please note:
  • Events created in the HubSpot app can only be triggered by ID.
  • Events created dynamically by name can only be created once. If you delete an event that was created this way, a new event will not be created if you try to dynamically trigger an event with the same name.
Last modified on May 15, 2026