Skip to content
Frameworks

React Native and Expo app analytics

2 min read · Updated · By the Reveata team

Short answerThe @reveata/react-native package records screens as pages, queues events offline, and sends them to the same Reveata website as your site. A Platform filter separates app from web, and funnels can start on the website and finish in the app.

Many products have a website that wins the customer and an app where they pay or use the product. Reveata's React Native SDK puts both in one report, so a funnel can start at your pricing page and end at a purchase in the app.

What you get

  • Screens as pages. With Expo Router, one hook in the root layout; with React Navigation, the container ref. Route names are recorded, never route parameters, and screens can be renamed, grouped or skipped.
  • Custom events as goals, with the same naming rules as on the website and up to 20 string properties.
  • Identify with the same userId as your website, so funnels count a person once across web and app.
  • Revenue links: revenue links the user to the payment your provider reports, by transaction id or email.
  • Offline support. Events are queued (up to 1,000), batched (up to 50) and retried with a growing delay. Events older than 7 days are not recorded.
  • A Platform filter (Website or App) on the dashboard, in segments, exports and the API.

How to install it

  1. Install @reveata/react-native. AsyncStorage is optional but recommended: it keeps the visitor id and queued events across restarts. With Expo, app details are read from expo-application and expo-device when installed.
  2. Call init once, as early as possible, with your website's tracking id and your Reveata address. Calls made before init are kept.
  3. Add screen tracking for Expo Router or React Navigation.

Full options are in the React Native guide. Expo itself is documented at docs.expo.dev (opens in a new tab).

How app payments are matched

How the app takes money How it is linked
Stripe PaymentIntent from your server Send Reveata.metadata() and put it in the PaymentIntent metadata (Stripe Elements analytics)
App Store or Google Play purchase Send it from your server with the Payments API and Reveata.getVisitorId()
Signed-in users Identify with the same userId or email as on the website

From website to app

An "Open in the app" link can carry the website visitor's token: reveata.appLink(url) on the website adds it, and the SDK reads it when the link opens the app within 10 minutes. The app then continues as the same visitor, signed in or not, and campaign parameters on the link are credited to the app visit.

Frequently asked questions

What device data does the SDK send?

The screen, visitor and visit ids, app id, version and build, operating system, device type and model, screen size, language and time zone. No advertising id is read, and the IP address is used for location and never stored.

Can I wait for consent?

Yes. Start with requireConsent: true and call setConsent with the person's choice. Until then nothing is recorded or stored.

When does an app visit end?

After 30 minutes without activity, as on the website. Returning from the background after that starts a new visit.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
IntegrationStripe Elements and PaymentIntent analyticsWhen your server creates a Stripe PaymentIntent for Elements, the Payment Element or a mobile app, put reveata_visitor_id and reveata_session_id in its metadata. Reveata reads them when payment_intent.succeeded arrives and credits the payment to that visit.IntegrationAngular analytics with ReveataPaste the Reveata snippet before the closing head tag of src/index.html. ng build keeps it in the built page, server-side rendering included, and the Angular Router's History API navigation is counted automatically. HashLocationStrategy needs data-hash="true".IntegrationAstro analytics with revenue attributionPaste the Reveata snippet with is:inline into the Astro layout that renders the head of every page. Astro then leaves the tag as written, view transitions are tracked, and payment links or checkouts started from your pages are credited to the visit behind them.IntegrationDjango analytics with revenue attributionPaste the Reveata snippet before the closing head tag of the base template your Django templates extend. Every page is tracked, the Django admin is not, and two hidden form fields let your checkout view put the visitor id into the payment's metadata.IntegrationDocusaurus analytics for documentation sitesAdd the Reveata script to the scripts array in docusaurus.config.js, or build the entry with @reveata/next/snippet. Page changes inside the docs are tracked by the script, so every page a reader opens is counted.IntegrationExpress.js analytics with a first-party proxyPaste the Reveata snippet into the layout, static HTML or front-end index.html your Express app serves. Two Express routes can serve the script from your own domain with your proxy secret, and your checkout route can copy the visitor id into the checkout metadata.