trackConversion()

Track post-install conversion events linked to the original attribution.

Method Signature#

Mobana.trackConversion(name: string, value?: number, flowSessionId?: string): Promise<void>

Usage#

your-app.tsx
// Track a simple conversion
Mobana.trackConversion('signup');

// Track a conversion with revenue value
Mobana.trackConversion('purchase', 49.99);

// Track subscription with value
Mobana.trackConversion('subscription', 9.99);

Parameters#

ParameterTypeDescription
nameRequiredstringConversion type name. Must be configured in your app settings in the Dashboard. Use snake_case for consistency.
valuenumberOptional monetary value for revenue tracking (e.g., purchase amount).
flowSessionIdstringOptional session ID from a flow's result. Links this conversion to the specific flow presentation for funnel analysis.

Behavior#

  • Never throws: The method silently handles errors to never block your app flow. Invalid conversion names or configurations are ignored.
  • Linked to attribution: Conversions are automatically linked to the install's attribution via the install ID.
  • Only for attributed installs: Conversions are only tracked if the install was attributed. Organic installs (no attribution match) don't record conversions.
  • Offline queueing: If offline, conversions are queued in AsyncStorage and sent when connection is restored.

Linking to Flows#

Connect conversions to specific flow presentations for detailed funnel analysis:

screens/Onboarding.tsx
// After showing a flow, link conversions to that session
const result = await Mobana.startFlow('pre-purchase');

if (result.completed) {
  // User completed the flow, now they might make a purchase...
  
  // Later, when purchase happens:
  Mobana.trackConversion('purchase', 49.99, result.sessionId);
}

Linking conversions to flow sessions allows you to see which flows lead to conversions in the Dashboard analytics.

Configuration Required#

Configure in Dashboard

Conversion types must be configured in your app settings before they can be tracked. Go to Dashboard → Your App → Settings → Conversions to add conversion types.

You can configure whether conversions are:

  • Repeatable — Can be tracked multiple times per install
  • Non-repeatable — Only counted once per install (e.g., signup)

Common Examples#

examples.tsx
// Common conversion events
Mobana.trackConversion('signup');           // User registered
Mobana.trackConversion('tutorial_complete'); // Finished onboarding
Mobana.trackConversion('first_session');    // First meaningful session
Mobana.trackConversion('purchase', 29.99);  // One-time purchase
Mobana.trackConversion('subscription', 9.99); // Subscription started
Mobana.trackConversion('share');            // Shared content
Mobana.trackConversion('level_10');         // Reached game milestone

Best Practices#

  • Use consistent naming: Stick to snake_case for conversion names across your app.
  • Track meaningful events: Focus on events that indicate user value, not every interaction.
  • Include revenue when applicable: Always include the value for purchases and subscriptions.
  • Link to flows: When conversions happen after a flow, pass the sessionId for better analytics.