Skip to main content
Sources & SDKs

Mobile SDK setup

Overview

Mobile SDKs batch events while the app is foregrounded, respects OS privacy prompts, and forwards deep links for attribution stitching. Install the vendor package, configure the workspace key from secure storage, and align event names with your server taxonomy.

Steps

  1. Add the TrackLayer mobile package to your Gradle, SPM, or CocoaPods manifest.
  2. Initialize inside Application / AppDelegate with environment flags (production vs sandbox).
  3. Forward lifecycle hooks (applicationDidBecomeActive) so sessions stay accurate.
TrackLayer.configure(apiKey: ProcessInfo.processInfo.environment["TRACKLAYER_KEY"]!)
TrackLayer.shared.track("AppOpen", properties: ["version": Bundle.main.appVersion])
  1. Use the debug console to force a flush during QA.

Troubleshooting

  • Missing events after backgrounding: enable background fetch only when policies allow; otherwise accept longer flush intervals offline.
  • IDFA gaps: gate tracking behind ATT prompts and fall back to first-party identifiers from your auth layer.
  • Duplicate purchases often come from client retries—dedupe with server-generated event_id values pushed to the client on confirmation.

Still need help?

Reach the team for onboarding, technical escalation, and privacy workflows.

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.

We use essential cookies to keep the site secure and functional. Analytics and third-party tags run only with your consent. See our Cookie Policy.