Skip to main content

Supported products

Please note: trackEvent has been deprecated and no longer works. Use trackCustomBehavioralEvent instead, as documented below.
Track custom events in your HubSpot account. Custom events can be tied to a contact record so you can see if and when a contact triggered that event.

Parameters

Usage

Migrate from trackEvent

To migrate from the deprecated trackEvent method, update your calls as follows:
  • Replace trackEvent with trackCustomBehavioralEvent.
  • Replace the id field with name, using the pe{HubID}_{name} format for the value.
  • Wrap any properties you’re sending in a properties object.
Before:
After:
Last modified on June 10, 2026