Star us on GitHub
Star
Welcome to highlight.io
Company
Mission & Values
Compliance & Security
Open Source
Getting Started
Overview
Fullstack Mapping
Backend / Server
Frontend / Client
Fullstack Frameworks
Product Features
Session Replay
Error Monitoring
General Features
Logging
Integrations
Integrations Overview
Amplitude Integration
ClickUp Integration
Discord Integration
Electron Support
Front Integration
Height Integration
Intercom Integration
Linear Integration
Mixpanel Integration
Segment Integration
Slack Integration
Vercel Integration
Tips
Content-Security-Policy
Local Development
Monkey Patches
Performance Impact
Proxying Highlight
Session Search Deep Linking
Troubleshooting
Upgrading Highlight
Highlight.io Changelog
Changelog 12 (02/17)
Menu
Docs / Highlight Docs / Product Features / Session Replay / Tracking Events

Tracking Events

A track event is a named event that you've defined. Adding a track event is useful if you want to be able to be alerted (see Recording Network Requests and Responses) or search for sessions where the user has done an action.

Example Scenario: A Shopping Cart

You'd like to see what users are doing that cause them to open the shopping cart. In your app, you'll add H.track():

import { H } from 'highlight.run'; import { getSubtotal } from '@utils'; const ShoppingCard = ({ items }) => ( <Button onClick={() => { H.track("Shopping Cart Opened", { subtotal: getSubtotal(items), numberOfItems: items.length }); }} > Shopping Cart </Button> )
Copy
API

See the Recording Network Requests and Responses API documentation for more information on how to use it.