Event Tracking
Event Tracking adds context to how users interact with your website or app. While page view data tells you how many people visit your pages, Event Tracking goes further by showing what users actually do while they’re there.
For example, 100 people may visit your homepage for 20 minutes, but you won’t know whether they walked away or engaged with content—like watching a promotional video or attempting to fill out a newsletter form but encountering an error.
Every website is unique, so the events you track and how you track them will vary. However, there are common website elements worth monitoring with events. Below is a selection of popular use cases and the types of questions they can answer when tracked with FirstHive CDP.
There are two main ways to set up Event Tracking within FirstHive CDP. The first is with the built-in Tag Manager. The second is by adding snippets of JavaScript code directly to your website. Details for both methods are below.
How to Set Up Event Tracking With FirstHive CDP Tag Manager (Recommended)
If you have FirstHive CDP Tag Manager installed, this is the easiest way to implement event tracking. You can create a Tag for each type of event you want to track. Below is a step-by-step example for tracking email link clicks on your site:
- Set up and configure FirstHive CDP Tag Manager (create a container and install the container code).
- Click on Tag Manager in FirstHive CDP and go to the Tags page.
- Click the green Create New Tag button.
- Select the FirstHive Analytics tag type.
- Give your Tag a descriptive name, e.g., FirstHive Event – Email Link Click.
- Confirm your FirstHive configuration. If unsure, use the default settings.
- Select Event as the Tracking Type.
Next, add your event structure:
- Event Category: Contact
- Event Action: Email Link Click
- Event Name: {{ClickDestinationUrl}}
- Event Value: (optional)
Note: The Event Name is dynamically populated from a Tag Manager Variable that pulls data from the website.
Next, set up your Trigger:
- Click to create a new trigger.
- For this example, select **All Links Click **under the Click section.
- Name the trigger
All Email Links. - To track only email links, configure the **Only trigger when **section:
- Field: Click Destination URL
- Condition: starts with
- Value:
mailto:
- Click **Create New Trigger **to finalize.
- Attach the Trigger to your Tag and click Create New Tag.
- Publish your container via the success message or menu option.
Once live, test by clicking an email link on your site and reviewing the Visits Log in FirstHive CDP. You should see your event recorded in real time
Note: Tag Manager can trigger tags based on IDs or classes. If your element lacks unique identifiers, consider adding a unique ID, class, or other HTML attribute—developer assistance may be needed.
How to Set Up FirstHive CDP Event Tracking With JavaScript
For more technical users, you can implement event tracking by adding a JavaScript snippet directly into your website code.
Links are the most common elements for tracking events. A standard HTML link:
<a href=“mailto:name@example.com” title=“Email Us”>Email Us</a>
You can extend it with an onClick function:
<a href=“mailto:name@example.com” title=“Email Us” onclick=“_fh.push([‘trackEvent’, ‘Contact’, ‘Email Link Click’, ‘name@example.com’]);“>Email Us</a>
This example tracks:
- Event Category: Contact
- Event Action: Email Link Click
- Event Name: name@example.com
The function works as follows **_fh.push([ ]) **sends data to FirstHive CDP, and trackEvent defines the event. The next attributes are interpreted as Category, Action, Name, Value (Value is optional).
For example, tracking a wishlist addition with a value:
_fh.push([‘trackEvent’, ‘Ecommerce’, ‘Add to Wishlist’, ‘Smartphone’, 1000]);
- Event Category: Ecommerce
- Event Action: Add to Wishlist
- Event Name: Smartphone
- Event Value: 1000
© 2026 FirstHive. All rights reserved.