Mobile Attribution SDK Setup for React Native and Expo: Config Plugins, Init Timing, and Verification Guide (2026)

Learn how to integrate mobile attribution SDKs in React Native and Expo managed workflows using config plugins, resolve initialization timing bugs, and verify install attribution before launch.

Key takeaways

  • Managed workflows remain intact with config plugins: Continuous Native Generation (CNG) allows React Native teams to generate reproducible native projects on demand. Using documented Expo config plugins removes the need to manually maintain iOS and Android native directories.
  • Initialization timing determines attribution accuracy: Initializing an attribution SDK late inside a React component lifecycle or after the initial screen renders causes dropped session tokens, missed install referrers, and broken deferred deep links. Native startup hooks must run before the JavaScript runtime mounts the view hierarchy.
  • AI coding agents require strict guardrails: Tools like Cursor and Claude Code can scaffold SDK dependencies and configuration files, but agents must not use fragile regex replacements on native files. Humans must still manage secure credentials, verify native diffs, and test on physical devices.
  • Build success does not equal attribution health: Compiling an app binary without build errors is no guarantee that telemetry is reaching the attribution server. Testing requires inspecting device logs, validating network payloads, and running install tests with custom campaign parameters.

Managed workflow vs. bare native: Maintaining attribution without manual bridge maintenance

For small teams building consumer subscription apps, choosing between Expo's managed workflow and a bare React Native project often comes down to native maintenance overhead. In a traditional bare workflow, developers commit the ios and android directories directly to version control. According to Expo Documentation, maintaining these native projects manually provides flexibility but creates significant ongoing maintenance overhead during framework and OS upgrades.

Native Maintenance Workflow Comparison
Manual Native Maintenance (Bare Workflow)
Git Repository
[ ios/ ] + [ android/ ]Manual edits, Podfiles, Gradle changes
Manual upgrades & fragile native diffs
Continuous Native Generation (CNG Workflow)
app.json / config plugins
npx expo prebuild
Transient Native Build Folders

Historically, integrating a Mobile Measurement Partner (MMP) SDK required modifying AppDelegate.mm, updating MainApplication.kt, configuring custom scheme handlers, and linking native pods manually. When an SDK lacked native configuration automation, teams were forced to eject from Expo's managed workflow. According to third-party analysis by devx AI labs, modern Expo-based approaches provide access to native device capabilities without requiring developers to write custom native bridging code.

Teams managing existing React Native applications can still adopt Expo tools and CLI commands incrementally while retaining their existing native directories, as documented in Expo Documentation. However, for greenfield apps or projects using Continuous Native Generation, manually editing native folders defeats the primary architectural benefit of Expo: keeping native project state generated, deterministic, and disposable.

Config plugins and Continuous Native Generation (CNG): Preserving managed builds in React Native

Continuous Native Generation treats the ios and android directories as build artifacts rather than source code. As detailed in Expo Documentation, CNG generates these directories from template files and configuration declarations whenever npx expo prebuild or an EAS Build pipeline executes.

To integrate mobile attribution SDKs without breaking CNG, developers use config plugins. As explained in Expo Documentation, config plugins allow projects to declare native configuration inside app.json or app.config.js instead of editing native files by hand.

{
  "expo": {
    "name": "SubscriptionApp",
    "slug": "subscription-app",
    "plugins": [
      [
        "sample-attribution-expo-plugin",
        {
          "appToken": "YOUR_SDK_APP_TOKEN",
          "enableDebugLogging": false
        }
      ]
    ]
  }
}

When authoring or configuring plugins for attribution SDKs, developers must adhere to several structural constraints:

  1. Static serializable properties: As documented in Expo Documentation, config plugin properties must remain static, JSON-serializable values. Passing dynamic JavaScript functions or runtime variables directly into the plugin configuration block will cause configuration parsing errors during prebuild.
  2. Explicit property definitions: Installing an SDK package does not automatically supply its required configuration properties. As noted in Expo Documentation, mandatory options (such as application tokens, scheme declarations, and domain associations) must be explicitly defined by the developer.
  3. Mod execution ordering: Config plugins use mods to modify underlying project files like AndroidManifest.xml and Info.plist. Expo Documentation notes that base modifiers must run after the other plugins that use them, ensuring that the final output is written to disk correctly during prebuild.

Using a documented Expo config plugin route allows native-capable builds to retain custom native SDK dependencies across clean checkouts and automated build pipelines (Airbridge Integration Guide).

SDK initialization timing: Preventing post-mount install loss and dropped deferred deep links

The most common implementation failure in React Native attribution integrations is improper SDK initialization timing. In standard React Native development, engineers often place third-party SDK setup inside a root component's useEffect or componentDidMount hook. For attribution, this is too late.

When an app launches from a paid ad campaign (e.g., via ad networks like Unity Ads, Moloco, or Appier), the native operating system passes launch parameters, Universal Links, Android App Links, or Play Install Referrer intents into the application process. If the attribution SDK initializes after the React view tree mounts, initial lifecycle events can be missed.

Attribution SDK Initialization Lifecycle
Incorrect Lifecycle (Post-Mount)
Native App Launch
JS Engine Starts
Root Screen Mounts
SDK Init (TOO LATE)Dropped deep links & install referrers
Correct Lifecycle (Pre-JS Startup)
Native App Launch
Native SDK Init (Lifecycle Listener)
JS Engine Starts
Handled Deferred Link

Native startup vs. post-mount behavior

As documented in third-party integration guides like Netvent Attribution SDK Bridge, bare React Native implementations initialize the SDK within native entry points: the iOS AppDelegate launch method and the Android MainApplication.onCreate method. Initializing at the application root outside of an individual UI activity ensures that attribution data is captured before the UI renders (Linkrunner).

In Expo managed workflows, native initialization before JavaScript execution is handled via lifecycle listeners. According to Expo Documentation, modules can hook into native startup using listeners such as ReactActivityLifecycleListener.onCreate to execute static setup tasks before the JavaScript runtime begins.

Deep linking workflows rely heavily on correct initialization sequence:

  • Cold-start links: According to Singular Help Center, bare React Native integrations forward launch and user activity data into the SDK so it can process launch-related deep links. With supported SDK versions, cold-start universal links are retained until configuration is fully loaded and then replayed to the application.
  • Deferred deep links: For users who click an ad before downloading the app, deferred deep links deliver the initial destination context after installation. According to Singular Help Center, the deferred deep link payload is delivered after the first session is sent to the attribution server and install attribution completes.

As emphasized in Airbridge's Integration Guide, compiling cleanly does not prove that attribution works. If initialization is deferred until after the first screen mounts, the app may lose attribution context on the user's first launch, causing attributed installs to be miscategorized as organic.

AI agent implementation guardrails: Scaffolding attribution with Cursor and Claude Code

AI coding assistants like Cursor and Claude Code are increasingly used to generate app scaffolding, write business logic, and install third-party dependencies. While agents can automate repetitive configuration tasks, attribution SDK integration requires specific guardrails to prevent silent tracking failures.

The Model Context Protocol (MCP) provides an open standard for connecting AI assistants to local project contexts, development tools, and external documentation. As outlined in Expo Documentation, the Expo MCP server allows AI-assisted developer tools to interact directly with Expo projects, inspecting logs, running diagnostic commands, and reading documentation supplied in Markdown format (Expo Documentation).

AI Coding Agent Guardrail Workflow
AI Agent Integration Pipeline
Cursor / Claude CodeRead app configuration & docs via MCP
Config Plugin InjectionEnforce static JSON props (No fragile regex)
npx expo prebuild
Human Review & VerificationReview native diffs, inject API tokens, test on device

When prompting an AI agent to install and configure an attribution SDK, apply the following controls:

  • Avoid raw regex modifications: As cautioned in Expo Documentation, plugins and configuration scripts should avoid regex-based string manipulation on native source files. Agents should be instructed to use standard config plugin structures and static app configuration.
  • Isolate plugin execution from network tasks: Generated config plugins must run synchronously without attempting network requests, external package installations, or interactive terminal prompts during the prebuild phase (Expo Documentation).
  • Require human credential management: Never ask an AI agent to hardcode production SDK tokens directly into repository files without review. Secure configuration values and API keys must remain managed through environment variables or secure credential storage (Airbridge Integration Guide).
  • Mandatory native diff inspection: According to Airbridge's AI Coding Agent Guide, SDK upgrades generated by AI tools must be verified by inspecting the generated git diff inside native directories after running npx expo prebuild.

End-to-end event verification: Testing attributed installs and telemetry before launch

Verifying an attribution integration requires validating both the local native build configuration and the telemetry payloads sent across the network.

1. Validating the native configuration build step

Before compiling a binary, verify that the config plugin applies its modifications to the native project templates correctly:

  • Modifier introspection: Run npx expo config --type introspect to inspect the internal modifier pipeline and verify generated properties without writing full project directories to disk (Expo Documentation).
  • Debug prebuild output: Execute EXPO_DEBUG=1 npx expo prebuild to print the full plugin execution stack and confirm that all custom mods execute in the expected sequence (Expo Documentation).
  • IDE plugin validation: The Expo Tools extension in VS Code automatically checks plugin structure and displays syntax warnings directly inside the editor (Expo Documentation).

2. Inspecting runtime telemetry and network payloads

Once the app runs in a local development build, inspect outgoing network requests and device logs:

  • Network payload inspection: Use debugging tools to inspect outgoing HTTP requests and server responses directly, ensuring that device properties, app tokens, and event payloads match expected schemas (Expo Documentation).

  • Device log forwarding: As detailed in Expo Documentation, runtime console logs appear in the Expo CLI terminal during development. However, production builds do not forward terminal logs automatically, meaning pre-release testing should be performed using device system logs or dedicated debugging flags.

  • Agent-assisted log inspection: MCP-connected tooling can collect native and JavaScript logs to help developers identify runtime errors or dropped events during test sessions (Expo Documentation).

  • Run expo config --type introspect to verify mod outputs

  • Enable SDK debug logging on a physical test device

  • Execute clean install test via custom campaign link / UTM

  • Confirm install event & campaign metadata reach dashboard

  • Trigger in-app purchase event; verify revenue & currency

  • Test cold-start deep link routing to target screen

  • Test deferred deep link routing after fresh installation

3. Executing a physical install attribution test

Simulator builds cannot validate hardware-specific attribution mechanisms like Google Play Install Referrer. As recommended in Linkrunner, teams should perform a test install on a physical Android device using a custom tracking link configured with test campaign parameters. Verify that the install event, campaign source, and revenue parameters populate inside the measurement dashboard before submitting the build for app store review.

For small teams managing subscription apps across paid channels, platforms like Airbridge provide self-serve access to attribution measurement. Airbridge's Core Plan starts at $40+/mo and includes a 30-day free trial with 500,000 data points/month included ($0.0001 per additional data point) and no annual contract, giving founders campaign attribution and raw data access from day one.

Maintaining SDK stability across React Native and OS upgrades

Mobile operating systems and the React Native core framework update frequently. When managing an app via Continuous Native Generation, keeping third-party attribution SDKs stable requires a structured maintenance routine:

    1. Update SDK packages in package.json
    2. Review SDK release notes for plugin prop changes
    3. Run npx expo prebuild --clean
    4. Inspect git diff in generated ios/ and android/ directories
    5. Execute clean first-install test on physical device
  1. Avoid direct native edits: Never patch generated files in ios or android directly. Any manual edits made outside of config plugins will be overwritten the next time npx expo prebuild or an EAS Build executes (Expo Documentation).
  2. Review native diffs during SDK updates: When upgrading an attribution SDK package, regenerate native projects locally using npx expo prebuild --clean and inspect the resulting changes in Info.plist, AndroidManifest.xml, and native startup classes (Airbridge Integration Guide).
  3. Verify lifecycle hooks after major React Native updates: Major React Native architecture updates (such as the New Architecture rollout) can alter native startup sequences. Always verify on a physical device that the SDK's native initialization listeners fire before the root view tree renders.

FAQS

Frequently asked questions

What should we do if we previously ejected from Expo to install an attribution SDK?

If your team ejected from Expo solely because an attribution SDK lacked clear configuration documentation, you can migrate back to Continuous Native Generation (CNG). By moving your custom native configuration into standard config plugins inside app.json or app.config.js, you can remove the committed ios and android directories from your repository and allow npx expo prebuild to manage native builds cleanly (Expo Documentation).

Why did our AI-generated SDK integration compile fine but fail to record install attributions?

A successful build only confirms that the native code and JavaScript dependencies compiled without syntax errors. If an AI coding agent placed SDK initialization inside a React component lifecycle method (such as useEffect), the application will render its first screen before the SDK completes native setup. This causes initial session tokens and install referrer parameters to be dropped (Airbridge Integration Guide).

How can I debug whether an Expo config plugin is modifying native files correctly without running a full native build?

You can use the Expo CLI introspection command npx expo config --type introspect. This command runs the config plugin pipeline and displays the resulting native modifications in JSON format directly in your terminal, allowing you to verify plugin output without compiling a complete native binary (Expo Documentation).

How do I verify deferred deep linking on a local development build?

Deferred deep linking occurs when a user clicks a campaign link without having the app installed, downloads the app, and opens it for the first time. To test this locally, configure debug logging in your SDK setup, uninstall any existing build from a physical test device, click your test attribution link, install the development build directly via USB or EAS internal distribution, and verify via device logs that the deferred deep link payload is received after the initial session is recorded (Singular Help Center, LinkForty Documentation).

Track your React Native installs with precision

Set up campaign attribution, deferred deep linking, and SKAN measurement with Airbridge Core.

Get Started Free