Setting Up Custom Events
- In the Muta web editor, add an “Emit Event” behavior to any element
- Give your event a unique name (e.g.,
signup_started
,premium_selected
,survey_completed
) - Optionally add custom data to pass along with the event
Example Usage
Custom Event Structure
Common Use Cases
User Actions
Track when users click specific CTAs or make choices:Navigation Control
Trigger app navigation based on flow interactions:Data Collection
Gather form submissions or survey responses:Feature Flags
Enable/disable features based on onboarding choices:Conversion Tracking
Track specific conversion events:Best Practices
- Consistent Naming: Use descriptive, consistent event names across your flows
- Type Safety: Consider creating a TypeScript interface for your custom events
- Error Handling: Always validate eventData before using it
- Documentation: Document your custom events and their expected data structure
- Analytics Integration: Forward custom events to your analytics provider for tracking
- Cleanup: Always remove event listeners when components unmount to prevent memory leaks