Skip to main content
Muta provides a flexible event system that works with any analytics provider (Mixpanel, AppsFlyer, Amplitude, Firebase, etc.). Events are emitted during key user interactions, allowing you to track and analyze your placement performance.

Basic Integration

Here’s a simple example of how to integrate analytics with your Muta placements:

Available Events

1. Flow Started (flowStarted)

Emitted when a placement flow begins displaying.

2. Screen Viewed (screenViewed)

Emitted when a user views a new screen in the flow.

3. Flow Completed (flowCompleted)

Emitted when a user successfully finishes the flow.

Variable Structure

When a flow completes, eventData["variables"] contains a dictionary where:
  • Key: Variable ID (e.g., var_1758310510757_as20wkeo4)
  • Value: Dictionary containing:
    • id (String): Unique variable identifier
    • name (String): Human-readable variable name from the Muta editor
    • type (String): Variable type (e.g., “text”)
    • value (Any): The collected value
    • defaultValue (Any): The default value
Example:
Output:

4. Flow Abandoned (flowAbandoned)

Emitted when a user exits the flow before completion.

5. Custom Events

Emitted when users trigger actions configured with “Emit Event” behavior in the Muta web editor.

Setting Up Custom Events

  1. In the Muta web editor, add an “Emit Event” behavior to any element
  2. Give your event a unique name (e.g., signup_started, premium_selected)
  3. Optionally add custom data to pass along with the event

Listening for Custom Events

6. Error Events (error)

Emitted when there are network or placement errors.

Integration Examples

Mixpanel Example

AppsFlyer Example

Best Practices

  1. Event Naming: Use consistent event naming conventions across your analytics platform.
  2. Data Enrichment: Add additional context to events when needed (e.g., user ID, app version).
  3. Error Handling: Implement proper error handling for analytics tracking.
  4. Custom Event Documentation: Document your custom events and their expected data structure.
  5. Performance: Consider batching events for better performance, especially for high-frequency events.
  6. Privacy: Ensure you’re not tracking sensitive information in your analytics events.