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

# AppsFlyer

> Track funnel events and measure campaign performance with AppsFlyer

The AppsFlyer integration sends funnel events to AppsFlyer. Use these events to measure conversions and optimize your campaigns across channels.

<Frame>
  <img src="https://mintcdn.com/funnelfox/g3yKg1fgN3HHfMyp/assets/appsflyer-integration.png?fit=max&auto=format&n=g3yKg1fgN3HHfMyp&q=85&s=ac93054fe66f42185fa5decaf40a620d" width="1920" height="879" data-path="assets/appsflyer-integration.png" />
</Frame>

## How it works

The AppsFlyer Web SDK is a JavaScript snippet that loads on your funnel pages and tracks visitor actions. Events are sent from the visitor's browser directly to AppsFlyer, where they appear in your dashboard for attribution and reporting.

FunnelFox sends events using the client-side AppsFlyer Web SDK. Server-side events are not currently supported.

## User identification

FunnelFox sets a Customer User ID on AppsFlyer to link events to the correct user. The ID is determined by the following priority:

1. **Custom input**: If you add an input element with the `_USERID_` element ID, its value is used as the Customer User ID.
2. **From your backend**: Fetch the user ID from your backend and set it using [custom code](/editor/coding) inside a Raw HTML element:

```html theme={null}
<script>
    fox.inputs.set('_USERID_', yourGeneratedId)
</script>
```

3. **Profile-based ID (default)**: If none of the above are provided, [FunnelFox profile ID](/dashboard/view-subscriptions-funnelfox#subscriptions-list) is used.

<Info>
  Setting `_USERID_` later in the funnel flow will update the Customer User ID for all subsequent events in that session.
</Info>

## Tracked events

| AppsFlyer Event            | Triggered When                          |
| -------------------------- | --------------------------------------- |
| `af_initiated_checkout`    | User sees the checkout element          |
| `af_purchase`              | Purchase completed successfully         |
| `af_content_view`          | Page or screen is presented to the user |
| `af_complete_registration` | User email is collected                 |

## Next steps

* [Set up AppsFlyer integration](/integrations/tracking/set-up-appsflyer)
