Install guide · framework · ~5 min

Install Admaxxer on React Native / Expo

Native SDK with expo-router tracking.

For mobile apps, Admaxxer ships a lightweight native SDK that wraps AsyncStorage for device-ID, captures app lifecycle + screen transitions (via expo-router), and sends events to the same /api/event endpoint as the web pixel.

Steps

  1. 1 Install the native SDK

    Add admaxxer-react-native to your Expo project.

    bash
    npx expo install admaxxer-react-native
  2. 2 Initialize in App.tsx

    Call initAdmaxxerNative at app boot before any screen renders.

    App.tsx tsx
    import { initAdmaxxerNative } from 'admaxxer-react-native';
    
    initAdmaxxerNative({
      websiteId: 'YOUR_WEBSITE_ID',
      appId: 'com.yourcompany.app',
    });
  3. 3 Wire expo-router (optional)

    If you use expo-router, wrap your root layout with <AdmaxxerRouter /> to auto-capture screen transitions.

    app/_layout.tsx tsx
    import { AdmaxxerRouter } from 'admaxxer-react-native/router';
    import { Slot } from 'expo-router';
    
    export default function Root() {
      return (
        <AdmaxxerRouter>
          <Slot />
        </AdmaxxerRouter>
      );
    }
  4. 4 Verify the install

    Load any public page on your site in a fresh browser tab. Within a few seconds, the Admaxxer dashboard realtime view should show the event. If nothing lands after 2 minutes, re-check the snippet is actually in the rendered HTML <head> (View Source, not just DevTools).

Verify installation

Troubleshooting

Events fire on iOS but not Android.
Check that AsyncStorage is linked (npx expo prebuild) and network-security-config allows https to admaxxer.com.
No events are showing up. What now?
Open DevTools Console and Network. Filter for script.js and /api/event. If they are blocked:csp, your Content Security Policy is blocking admaxxer.com — see /documentation/troubleshoot/csp. Also double-check that data-website-id matches the ID shown in your dashboard.
Events show up in staging but not production.
Confirm data-domain matches the production hostname exactly (no protocol, no trailing slash). Also confirm the website's Allowed Domains list in settings includes the prod domain.
My site is a single-page app — am I missing pageviews?
Use script.hash.js if you rely on location.hash routing. Otherwise the default script.js already hooks history.pushState/replaceState and tracks SPA navigations.