> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mutalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Deep Linking

> Create dynamic onboarding experiences based on user acquisition sources

Deep linking allows you to show different onboarding flows based on where your users come from. This is perfect for tailoring your user experience to match the messaging from different ad campaigns, product pages, or referral sources.

## How It Works

Instead of creating complex variant systems, Muta's placement system already supports deep linking scenarios perfectly. You simply create different placements for different user sources.

## Example: Multi-Channel Ad Campaign

Let's say you're running ads on TikTok, Instagram, and LinkedIn with different messaging for each platform. You want your onboarding to match the ad creative users clicked on.

### Step 1: Create Separate Placements

In your Muta dashboard, create placements for each source:

* `onboarding-tiktok` - Fun, video-focused onboarding
* `onboarding-instagram` - Visual, story-driven flow
* `onboarding-linkedin` - Professional, feature-focused flow
* `onboarding-default` - Generic flow for organic users

### Step 2: Handle Deep Links in Your App

```tsx theme={null}
import { Muta } from '@mutalabs/react-native-muta';
import { Linking } from 'react-native';

// Parse the deep link to determine the source
const handleDeepLink = (url: string) => {
  const source = parseSourceFromUrl(url); // Your URL parsing logic
  
  // Map sources to placement IDs
  const placementMap = {
    'tiktok': 'onboarding-tiktok',
    'instagram': 'onboarding-instagram',
    'linkedin': 'onboarding-linkedin',
  };
  
  const placementId = placementMap[source] || 'onboarding-default';
  
  // Display the appropriate onboarding flow
  Muta.displayPlacement({
    placementId: placementId,
    bgColor: '#000000'
  });
};

// Listen for deep links
Linking.addEventListener('url', (event) => {
  handleDeepLink(event.url);
});
```

### Step 3: Configure Your Ad Campaign URLs

Set up your ad campaign URLs to include source information:

* TikTok: `myapp://onboard?source=tiktok`
* Instagram: `myapp://onboard?source=instagram`
* LinkedIn: `myapp://onboard?source=linkedin`

## Best Practices

### 1. Naming Conventions

Use clear, consistent naming for your placements:

* `[placement-name]-[source]`
* `[placement-name]-[source]-[campaign]`
* `[placement-name]-[source]-[variant]`

### 2. Always Have a Default

Always create a default placement as a fallback for:

* Organic users
* Unrecognized sources

## Next Steps

* Learn about [Analytics Integration](/sdk/react-native/analytics) to track performance by source
* Explore [Error Handling](/sdk/react-native/error-handling) for fallback strategies
* View the [API Reference](/sdk/react-native/api-reference) for all available options
