Please note: Events are only available in the Enterprise edition of HubSpot. Both Professional and Enterprise accounts have the ability to create lists based on visited URL, but only Enterprise can create a visited URL event report.
Why use Custom Events?
You may be thinking, "but what if I need to track something that is more advanced than the types you discussed earlier in the guide?” We had the exact same thought, which is why we created Custom Events.
When creating a Custom Event, you have two options:
- HTTP API Event
Navigate to Events
From your HubSpot Dashboard, navigate to Reports > Events.
Create a new Event
On the right, select the blue Create new event button.
Create a custom event
When selecting Track type of event, select Custom Event.
If you only want this event to be triggered on a specific page, add the URL to the URL (optional) box.
Update the first line of the automatically generated code in the editor to if (true) or remove that rule all together to have the event fire on every tracked page load.
HTTP API Events
When creating a HTTP API Event, a URL will be automatically generated containing the following necessary parameters:
- _n - the Event_ID of the event you are recording
- _a - your HubSpot ID
Next, you need to name and save your new event.
In order to successfully connect a triggered HTTP API Event to a contact record in HubSpot, you need to pass the contact’s email address, &email, in the request URL. If a contact record does not yet exist for this email address, a new record will be created. Otherwise, the event will be attributed to the existing contact.
Two other useful parameters that can be used are the _m and property parameters. Add &_m to the Request URL to add a value to a contact’s Revenue field and &property to the Request URL to set a contact property. This new property information will overwrite a null value, but will not update a property that already contains a value.
For example, here is a test URL to trigger an event:
Lastly, to trigger the HTTP API Event, you must make a request to our tracking API with the path /v1/ element.
For more information about HTTP API Events, refer to our Developers' forum.