06.08.2020

Marketing & Creative

How to Set Up and Manage Custom Events & Triggers in HubSpot

8 min read

Tasneem

event triggers, marketing, growth

In this blog post, Tasneem Rossouw, Copywriter at Huble Digital, simplifies the HubSpot event trigger ecosystem and walks you through how to set up and manage customer event triggers in HubSpot.

Your marketing teams pour their time, money and energy into driving people to your website, but with competition fiercer than ever before, the job just isn’t complete when someone lands there. To gain the leading edge, it literally pays to ensure you’re tracking user behaviour while they’re on your site. This insight will mean your marketing strategy (and spend) can be honed for precision and accuracy. 

Imagine having a website that’s fine-tuned to the point where each element is optimised to drive a desired action in visitors — HubSpot event triggers make it possible. They allow you to measure the actions a visitor takes on your website and to determine which of these “events” leads to conversions, sales and other desired outcomes. The key benefit? You can iteratively refine your lead nurturing and marketing automation strategies for optimal ROI on your sales and marketing spend.

The HubSpot event trigger ecosystem

Custom events are one of four event types, alongside:

Custom events help you track micro-engagements even further. You now gain additional insight into whether they’re interacting with an element in a particular way

Sound exciting? Check out what other tools and features are available to you with the HubSpot Enterprise Marketing Suite. 

Here’s how to set up and manage your own custom events: 

What you’ll need to get started

To set up your first HubSpot custom event, you’ll need the following:

  • A subscription to HubSpot Marketing Hub Enterprise

  • The help of a developer, as you’ll need to insert the event into your JavaScript file, or server-side script

How to create your custom event in the HubSpot platform

In your HubSpot account:

  • Navigate to Reports > Analytics Tools
  • Click Events
  • In the upper right, click Manage events
  • In the upper right, click Create event
  • In the right panel, set up your event:
    • Enter an Event name
    • Click the Tags menu to select or enter a tag. This allows you to easily find and keep track of your event.
    • In the Event type section, select Custom event.
  • Click Next. 

create-custom-event

What happens next depends on the API you’re using to trigger the event. Here’s how to complete the process of creating your custom event using either the Events JavaScript API, or Events HTTP API.

For JavaScript events:

  • Enter the code into the Custom JavaScript field. Any code you enter here will automatically be included as part of your HubSpot tracking code. 
  • After adding your JavaScript, click Save to create your event. 
  • You’ll be redirected to the events dashboard. Hover over the event and:
    • Click the More dropdown menu, then select Edit
  • At the bottom right, click Next
  • You’ll see an ID has been generated for the event. Copy and paste the code snippet in the JavaScript callback where you want that event to trigger. 

 

Things to remember:

  • By default, value will be set to null. 
    • This optional argument can be used to track the revenue of an event. 
    • If the event is associated with a contact record, the value will be used to increment the hs_analytics_revenue property. 
  • Each time the event runs, the value associated with the triggered event will be added to the Revenue field on the contact’s record. 
    • When setting up the conversion value, either enter a specific value or set a dynamic one. 
    • To set a dynamic value, enter a JavaScript variable or a full jQuery selector. 
  • If you’re adding a value, make sure you add it to the value parameter before adding the code snippet to your JavaScript file.  

 

create-custom-event-javascript

For HTTP API events:

  • Because you’re using the Events HTTP API, you don’t need to enter any JavaScript into the Custom JavaScript field. Therefore, simply click Save to create your event. 
  • You’ll be redirected to the events dashboard. Hover over the event and:
    • Click the More dropdown menu, then select Edit.
  • Click Next and view the ID that’s been generated for the event. You can now use this ID to trigger your custom HubSpot event using an HTTP GET call.

 

Things to remember:

  • When creating an HTTP API event, a URL is automatically generated which contains the following required parameters:
    • _n: the Event ID of the event
    • _a: your HubSpot ID
  • 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 doesn’t exist yet for this email address, a new record will be created. Otherwise, the event will be attributed to the existing contact. 

 

Well done! Your HubSpot custom event is now live.

**We’ve extracted these key takeouts from the HubSpot Knowledge Base article on the topic, because no-one’s summarised it better than they have. Visit for a closer look at working with custom events, and for what to do when you’ve reached your account event limit. 

What do custom events make possible?

Custom events can trigger the same actions as submitting a form or clicking a CTA. For example, you could create a smart list that captures all contacts that performed a particular action that served as an event trigger. This, in turn, can enrol them in a workflow that offers them content related to the interest expressed through their action. 

Take an online store purchase as a use case. Setting up a custom event trigger for once a visitor has calculated their shipping, can segment them in your contacts list and trigger a workflow. They’ll get a gentle reminder to complete their purchase delivered directly to their inbox!

Analysing and managing your event completions

HubSpot’s event analytics tool is the key to turning each recorded action into actionable insights into your sales and marketing spend. You can generate a chart to show event completions by selecting a date range, frequency and tags from the Analytics Tools > Events dashboard. 

event-chart

You also have the option to view specific events in the chart, by selecting the checkbox you’ll find to the left of the event name, in the accompanying table.  

event-table

With this level of direct feedback on user behaviour, you’re all set to constantly refine the way you reach out to, and communicate with prospects and customers — optimising your sales and marketing ROI and driving for customer delight. Get to grips with the details on analysing and managing event completions with the HubSpot Knowledge Base article, or reach out to us at Huble Digital. 

We’re a HubSpot Elite Solutions Partner, and a full-service global digital business consultancy. At the heart of our mission is our desire to help you transform your business core with the help of the HubSpot platform.

Contact the team and let’s chat about how we can help you leverage the insights that tools like custom events bring, to the best advantage of your business. 

Generate Demand & Build Brand Equity

Partner with Huble, a HubSpot marketing agency that understands the balance of strategy, creativity, and technical expertise. We help large and mid-market companies leverage HubSpot to elevate their marketing efforts.

Latest Insights

Sales & Revenue

11 min read

A day in the life of an AI-powered HubSpot Sales Rep

Explore how HubSpot’s Breeze AI changes a typical sales rep's day and the practical ways AI sales enablement can support your sales efforts.

Read more

HubSpot Implementations

14 min read

Replacing or integrating your CRM: Can HubSpot replace Salesforce?

Can Hubspot Replace Salesforce? We explore both CRM Software Systems. Discover HubSpot’s benefits and find out why Hubspot may be the CRM for you.

Read more

HubSpot Implementations

17 min read

Enhancing real estate success with HubSpot

In this article, we'll explore the use cases for HubSpot in the real estate industry, covering sales, CRM, marketing, service, and website management.

Read more

HubSpot Implementations

8 min read

How AI in change management transforms CRM implementations

Explore how AI in change management simplifies CRM transitions, reduces challenges, and accelerates adoption for enterprise organizations.

Read more

HubSpot Implementations

14 min read

Build a Composable Customer Data Platform with HubSpot and Snowflake

Discover how a composable CDP unifies customer data for streamlined experiences, integrating HubSpot with Snowflake for scalable analytics and engagement.

Read more

HubSpot Implementations

12 min read

Enterprise CRM: essential features & implementation guide (2025)

Explore key features of enterprise CRM software that large businesses need and what to look for when comparing CRM systems.

Read more

HubSpot Implementations

10 min read

HubSpot AI security FAQ: what CTOs and CIOs need to know

Discover how to securely adopt HubSpot AI while meeting compliance demands. Learn best practices to protect data and navigate regulatory challenges.

Read more

Sales & Revenue

17 min read

HubSpot HIPAA compliance: everything you need to know

Explore HubSpot's HIPAA compliance. We cover the basics of HIPAA, challenges HubSpot faced, and HubSpot's new tools to meet compliance requirements.

Read more

AI Solutions

13 min read

AI use cases across sales, marketing and customer service

Explore practical AI use cases across marketing, sales, and customer service to demonstrate how AI can solve common business challenges.

Read more

Sales & Revenue

13 min read

Your guide to combining data and AI in sales enablement

Explore how AI in sales enablement transforms training and coaching with data-driven insights.

Read more