Event Tracking
Event tracking allows you to monitor specific user interactions or occurrences within your experiments. This data can be invaluable for analyzing user behavior and measuring the success of your variants.
Basic Usage
To track an event, use the global window.oboe.fireEvent
function:
window.oboe.fireEvent('button_clicked');
The event name should be a string, preferably in snake_case format for consistency.
Where to Use Events
You can fire events from two locations:
- Custom JS code within an individual experiment
- Shared JS code that applies across multiple experiments
Automatic Data Enrichment
When you fire an event, Oboe automatically enriches it with important contextual data:
- Experiment ID
- Variant ID
- Timestamp
- Additional Experiments Concurrently Running
Examples
Basic Event Tracking
// Track when a user clicks a specific button
document.querySelector('#signup-button').addEventListener('click', () => {
window.oboe.fireEvent('signup_button_clicked');
});
Best Practices
- Consistent Naming: Use descriptive, snake_case names for your events (e.g.,
user_signed_up
,cart_updated
) - Event Planning: Plan your event tracking strategy before implementing experiments
- Validation: Test your events in development before deploying to production
- Documentation: Keep a central record of all events being tracked across experiments
Viewing Event Data
Events can be viewed and analyzed in the Oboe dashboard under the “Events” section. Here you can:
- Filter events by experiment
- View event frequencies
- Analyze event patterns by variant
- Export event data for further analysis
Limitations
- Events are only tracked for users who are part of an active experiment
- Event names should not exceed 100 characters
- Avoid firing excessive events in short time periods to prevent rate limiting