Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Latest commit

 

History

History
34 lines (27 loc) · 1.07 KB

File metadata and controls

34 lines (27 loc) · 1.07 KB
title slug createdAt updatedAt
Tracking Events
tracking-events
2021-09-13 23:23:28 UTC
2022-03-21 18:25:39 UTC

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>
)

API

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