Blog
iOSBy Marwan AkhandafJune 19, 20261 min read

iOS Analytics SDK Setup: A Privacy-Safe Swift Checklist

Follow this iOS analytics SDK setup checklist for Swift apps, including package install, test mode, safe events, and privacy payload rules.

Summary

A step-by-step Swift instrumentation checklist for teams adding AppMetricsKit or another privacy-safe analytics SDK.

Install the SDK through Swift Package Manager.

Apply the consent state before automatic launch tracking begins.

Start with launch, onboarding, paywall, purchase, and error events.

Install and configure once

Add the analytics package through Swift Package Manager and configure it once at app startup. Configuration should include the ingest endpoint, ingest key, test mode, collection consent, automatic launch behavior, and payload guardrails.

Test mode does not replace consent. If your app waits for analytics consent, configure collectionEnabled and automaticAppLaunchTracking as false, then enable collection and record App.launch only after consent. Make test mode a build setting so development and production semantics are intentional.

Instrument the first useful events

Start with App.launch so the dashboard can confirm delivery. Then add Onboarding.started, Onboarding.completed, Paywall.viewed, Paywall.ctaTapped, Purchase.started, Purchase.completed, Purchase.failed, and Error.occurred.

Each event should have a small payload. Use plan, source, step, screen, variant, productId, and reason codes. Do not send raw names, emails, phone numbers, or free-form text.

Validate in Live Events before release

Run the app in the simulator or on a test device and watch the Live Events page. Confirm event names, test mode status, app version, platform, and payload keys.

If the first event arrives but downstream funnels are empty, the SDK is working but the taxonomy is incomplete. Add the next funnel events before optimizing product decisions.

FAQ

Common questions

Where should an iOS app configure analytics?

Configure analytics at app startup before tracking events, usually in the app entry point or application delegate flow. Apply the current consent state in that first configuration.

Should TestFlight builds use test mode?

Use test mode for TestFlight builds that validate instrumentation. If TestFlight is part of a production beta program, choose the mode deliberately and document how those events should be counted.