Guides
Custom Events
Custom Events allow you to track meaningful user actions in your product and use them to target your onboarding content.
Growth Plan Required
Custom Events are available on the Growth plan. Upgrade your plan to unlock this feature.
What are Custom Events?
Custom Events track specific user actions in your product. You can use them to:
- Track feature adoption (e.g., "User created first project")
- Monitor conversion actions (e.g., "User completed purchase")
- Measure engagement (e.g., "User exported report")
Setting up Custom Events
There are three ways to track custom events:
1. SDK Tracking (Code)
Track events programmatically using the Hopscotch SDK:
window.Hopscotch("track", "Feature Activated", {
value: 100,
category: "onboarding"
})
Auto-registration: When you track an event via the SDK that doesn't already exist, Hopscotch automatically creates it for you. The new event will appear in your Events dashboard. This makes it easy to start tracking without pre-registering events, but be mindful of typos as they'll create duplicate events.
See the Browser SDK documentation for full details.
2. Click Tracking (No-Code)
Track when users click specific elements:
- Go to Events in your Hopscotch dashboard
- Click New Event
- Select Click as the trigger type
- Enter a CSS selector for the element (e.g.,
#upgrade-button,.submit-btn) - Optionally add a page URL filter to only track clicks on specific pages
Tips for CSS selectors:
- Use IDs when possible (
#my-button) for reliability - Class selectors work too (
.action-button) - You can use attribute selectors (
[data-action="submit"])
3. Page Visit Tracking (No-Code)
Track when users visit specific pages:
- Go to Events in your Hopscotch dashboard
- Click New Event
- Select Page Visit as the trigger type
- Enter a URL pattern (supports
*wildcards)
URL pattern examples:
https://app.example.com/dashboard- Exact matchhttps://app.example.com/projects/*- Any project page*/settings/*- Any settings page on any domain
Best Practices
Event Naming Conventions
Use clear, descriptive names for your events:
- Good: "First Project Created", "Upgrade Completed", "Report Exported"
- Avoid: "click1", "event_a", "test"
What to Track
Focus on meaningful actions that indicate user success:
- Activation events: First time using a key feature
- Conversion events: Completing a purchase or upgrade
- Engagement events: Using advanced features
- Retention signals: Returning to the product
Using Events for Targeting
Custom events can also be used to target your onboarding content. For example:
- Show a tour to users who haven't completed a specific event
- Target power users who have completed an event 10+ times
- Re-engage users who haven't triggered an event in 30 days
Individual Event Targeting
Use the Custom Event filter to target based on the current user's events:
| Operator | Description |
|---|---|
| has occurred | User has triggered this event at least once |
| has not occurred | User has never triggered this event |
| occurred in last X days | User triggered this event within the specified days |
| has not occurred in last X days | User hasn't triggered this event in the specified days |
| occurred at least X times | User triggered this event X or more times |
| occurred at most X times | User triggered this event X or fewer times |
| occurred exactly X times | User triggered this event exactly X times |
| first occurred before/after | When the user first triggered this event |
| last occurred before/after | When the user most recently triggered this event |
| occurred with property | Event has a specific property value |
Company-Level Event Targeting
If you've set up company identification, you can target based on events from any user in the same company using the Company Event filter.
This is powerful for multi-user products where you want to:
- Skip onboarding if a teammate has already completed setup
- Show upgrade prompts only to companies where no one has used a premium feature
- Target expansion content to companies that have adopted one feature but not another
| Operator | Description |
|---|---|
| has occurred (any user in company) | Anyone in the company has triggered this event |
| has not occurred (any user in company) | No one in the company has triggered this event |
| occurred in last X days (any user in company) | Someone in the company triggered this event recently |
| has not occurred in last X days (any user in company) | No one in the company has triggered this event recently |
| occurred at least X times (across company) | Total event count across all company users |
| occurred at most X times (across company) | Total event count across all company users |
Example use cases:
New team member onboarding: Show a "Getting Started" tour to users whose company has already set up the product (someone else completed "Setup Completed" event), but the current user hasn't seen the "Dashboard Tour".
Feature discovery: Show a tooltip about a premium feature to users at companies where no one has used it yet ("Premium Feature Used" has not occurred for company).
Expansion targeting: Target users at companies that have adopted Feature A but not Feature B to encourage broader adoption.
See How to Identify Users for setup instructions.
Still have questions?
We are here to help. Don't hesitate to reach out by email any time.