Integrations · Apps

Expo, screens and events.

Count screens, events and signed-in users from your Expo app with the app client. It sends straight from the device, and what can’t be sent waits in order until the app is back online.

Offline queueNothing secret in the appEach screen is a page
ExpoTS
app.screen('Home');
app.event('Purchase', {
  revenue: { amount: 12.5, currency: 'EUR' },
});
app.identify(user.id);

Illustration

At a glance

App stats, offline included.

What changes when your Expo app uses the SDK.

  • Nothing secret

    The site key and receive address are public.

  • Screens as pages

    Each screen counts as a page of the site.

  • Offline queue

    Waits in order and goes out when the app is back.

  • Opt-out switch

    setEnabled(false) stops all sending.

The app client

What the app sends.

From createAppClient in nahnu-analytics-sdk/app.

MethodWhenDetails
screen()On each screen changeWith React Navigation’s state listener
event()When something happensWith revenue, such as a purchase
identify()After sign-inOne person across devices
pause() and resume()When the app goes to the background and backFrom AppState
flush()When the device is back onlineCall it when NetInfo says you’re back
setEnabled(false)From your settingsStops all sending

Where it shows

Where you see it.

Each app is a site, or a domain on the user’s site.

  • Screens

    Each screen counts as a page.

  • Goals and events

    Purchases and other events, with revenue.

  • iOS and Android

    The platform property separates them in Goals & events › Properties.

  • Signed-in users

    identify() after sign-in.

  • App and web apart

    Give the app its own site or its own domain.

  • App versions

    appVersion on every screen.

Offline

What can’t be sent waits.

What can’t be sent waits in order and goes out with the next screen, on resume(), or on flush().

  • Pass storage: AsyncStorage (or MMKV) to keep the queue across restarts
  • Up to maxQueue items are kept (default 200; the oldest go first)
  • Queued items count when they arrive, not when they happened
Read the apps guide →
Offline queueIllustration
  • pending()How many wait
  • maxQueue200 by default
  • flush()Send now

Swift, Kotlin or anything else

Plain HTTP works too.

POST JSON as text/plain to the receive address: a screen, an event, or leaving a screen after a number of seconds. The address’s host must be one of the site’s domains.

  • v: a screen
  • c: an event, with an optional amount
  • x: leaving a screen after e seconds
Read the apps guide →
Request bodyJSON
{"k":"<site key>","n":"v","u":"https://app.example.com/Home","r":"","w":390,"p":{"platform":"ios"}}

Questions

Expo questions

Something else? Ask us.

Is anything secret in the app?

No. The site key and receive address are public.

What happens offline?

Events wait in order and go out with the next screen, on resume() or on flush(). Pass storage to keep them across restarts.

Does Expo need anything different?

No. Expo apps use the same app client as React Native apps.

Can users opt out?

Yes. setEnabled(false) stops all sending, for an opt-out switch in your settings.

Try it on every client site.

Unlimited websites, every feature, one license.