Skip to main content
The @tinyanalytics/react-native SDK brings cookieless analytics to React Native apps: screen views, custom events, errors, and identify() — all reported in the same dashboard as your websites. It uses a persistent install ID instead of a browser fingerprint, so no cookies and no device fingerprinting are involved.

Before you start

  • A mobile-type site in tinyanalytics. Mobile apps use a different identity model, so they need their own site type — a web site rejects it. See Create a mobile site below.
  • A React Native app (React Native 0.72 or newer).

Create a mobile site

1

Add a website

In the dashboard, start adding a new site, then set the Type to Mobile app instead of Website.
2

Enter your app identifier

Give the site your app’s bundle ID / package name (for example com.example.app). This is read-only after the site is created.
3

Note the numeric site ID

You’ll pass this site ID to the SDK’s init() below.

Install the SDK

AsyncStorage is optional but recommended — it persists the anonymous install ID across app restarts, so a returning user isn’t counted as new each launch.

Initialize

Call init() once, early in your app’s startup. analyticsHost and siteId are the only required options:

Track screens and events

Screen views are the mobile equivalent of pageviews — a screen name becomes the path you see in the Pages report:

Track screens automatically with React Navigation

Wire the navigation tracker once and every route change becomes a screen view:

Verify

Run the app and send a screen view with analytics.screen().
Your SDK setup is working when the screen name appears as a path in the Pages report for your mobile site.

The mobile identity model

Native apps sit behind carrier NAT and have no browser User-Agent, so the web fingerprint would collapse many devices into one. Instead the SDK mints a persistent install ID and sends it as anonymousId; the server derives a stable, site-scoped user ID from it. identify() layers your own product-user ID on top and backfills recent events — exactly as on the web. No cookies, no device fingerprinting, no personal data at rest. See how cookieless identity works.

API

Configuration

analyticsHost and siteId are required. The rest are optional:

What differs from web tracking

  • Screens, not pagesscreen() names appear as paths in the Pages report; there’s no auto-pageview from a URL.
  • No Core Web Vitals — the Performance report is web-only.
  • Referrer and channel aren’t populated from a mobile app, so acquisition-by-channel reports stay empty for mobile sites.

Track custom events

The event model, shared with the web.

Identify users

Attach a stable user ID and traits.

Cookieless identity

How the install ID stays private.

Revenue analytics

Track purchases from your app.