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

# Analytics Quickstart

> Turn on Appeeky Analytics for an app, add the React Native SDK, link RevenueCat and check that events arrive

This guide takes an Expo or React Native app from zero to its first events in Appeeky Analytics.

***

## Prerequisites

1. An Appeeky account with the app in **My Apps**.
2. A React Native or Expo app that you can build as a development build. The SDK's native module does not run in Expo Go.
3. For revenue: RevenueCat in the app, and the RevenueCat webhook connected in Appeeky. See [Revenue](https://docs.appeeky.com/docs/analytics-revenue.md).

***

## Setup

**1. Turn on Analytics for the app**

In Appeeky, open the app under **My Apps → Attribution** and click **Turn on attribution**. Appeeky creates the app in the analytics service and shows its publishable key (`apk_pub_…`) and ingest endpoint.

You can do the same with the API:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://api.appeeky.com/v1/analytics/apps/YOUR_APP_ID/enable" \
  -H "X-API-Key: YOUR_APPEEKY_KEY"
```

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "data": {
    "appId": "6443843426",
    "platform": "apple",
    "publishableKey": "apk_pub_...",
    "endpoint": "https://ingest.appeeky.com/v1/ingest",
    "enabledAt": "2026-10-20T09:12:44.000Z"
  }
}
```

The call is safe to repeat: if Analytics is already on, it returns the existing key.

> [!NOTE]
>
> The publishable key is not your Appeeky API key. It ships inside your app and can only write events for that one app. Never put your Appeeky API key in an app.

**2. Install the SDK**

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
npx expo install @react-native-async-storage/async-storage expo-application expo-device
npm install @appeeky/analytics-react-native
```

`expo-application` and `expo-device` are optional. They add the app version, build number and exact device model.

**3. Add the config plugin and rebuild**

Add the plugin to `app.json` (or `app.config.js`):

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "expo": {
    "plugins": ["@appeeky/analytics-react-native"]
  }
}
```

The plugin adds the Info.plist keys that make iOS send copies of SKAdNetwork and AdAttributionKit postbacks to Appeeky. See [SKAdNetwork](https://docs.appeeky.com/docs/analytics-skadnetwork.md) before you add it if another provider already receives those copies.

Rebuild the app as a development build (for example `npx expo run:ios` or an EAS development build). The native module adds Apple Search Ads attribution, SKAdNetwork conversion values and the Play Install Referrer.

**4. Initialize the SDK**

Call `init` once, as early as possible in the app's startup:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
import Appeeky from "@appeeky/analytics-react-native";

Appeeky.init({ key: "apk_pub_..." });
```

The SDK sends to `https://ingest.appeeky.com/v1/ingest` by default. On first launch it records `first_open`, starts a session and collects the install's attribution.

**5. Link the install to RevenueCat**

Pass the RevenueCat app user id so each purchase can be matched to the install that made it:

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
import Purchases from "react-native-purchases";

Appeeky.identify(await Purchases.getAppUserID());
```

Call `identify` again with the new id after `Purchases.logIn()`, and pass `null` on logout.

**6. Track screens**

Screens power the screen breakdown, the funnel and the purchase journey in sale alerts. With React Navigation:

```tsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
<NavigationContainer
  ref={navigationRef}
  onStateChange={() => {
    const route = navigationRef.getCurrentRoute();
    if (route) Appeeky.screen(route.name);
  }}
>
```

Name your paywall screen `Paywall` to match the default funnel (first open → `Paywall` → trial started → trial converted), or [change the funnel](https://docs.appeeky.com/docs/analytics-metrics.md#funnel).

***

## Check That Events Arrive

1. Turn on logging while you test: `Appeeky.init({ key: "apk_pub_...", debug: true })`. The SDK then logs rejected batches and network errors.
2. Open the app on a device or simulator and move between a few screens. Events are sent every 10 seconds, when 20 are queued, and when the app goes to the background.
3. In Appeeky, open the app's Analytics dashboard and choose **Today**. The install shows under installs and online users once the first batch has been sent.

You can also read the dashboard with the API:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://api.appeeky.com/v1/analytics/apps/YOUR_APP_ID/dashboard?range=today" \
  -H "X-API-Key: YOUR_APPEEKY_KEY"
```

> [!TIP]
>
> A first install from a simulator or a development build is usually **Organic**. That is expected: it did not come from an ad, a link or a referrer.

### Common problems

| Symptom | Cause |
| - | - |
| `401 INVALID_KEY` in the debug log | The key is wrong, or it was rotated. Copy the current key from Appeeky. |
| Events arrive but there is no Apple Search Ads or referrer data | The app runs without the native module (Expo Go, or no rebuild after adding the plugin). |
| Purchases show as unattributed | `identify` is not called, or it is called with a different id than RevenueCat uses. |
| No revenue at all | The RevenueCat webhook is not connected in Appeeky, or the purchases are sandbox purchases. Only production events count. |

***

## Next Steps

* [SDK Reference](https://docs.appeeky.com/docs/analytics-sdk-reference.md): custom events, options and automatic events
* [Attribution](https://docs.appeeky.com/docs/analytics-attribution.md): how sources are detected
* [Smart Links](https://docs.appeeky.com/docs/analytics-smart-links.md): links for your campaigns
* [Sale Alerts](https://docs.appeeky.com/docs/analytics-alerts.md): Telegram messages for new sales


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.