Product Benefits Pricing Guides Docs About Contact us Try it out
Analytics tools

Amplitude Swift Init Identity Tracking Guide

Amplitude Swift 1.19.0 adds userId and deviceId to Configuration. Track identity at launch and cut anonymous first events in your iOS app.

· 3 min read

The first events of a session are often the most valuable and the least reliable. If a returning user opens your app and the SDK starts before the user ID is set, those events are anonymous. Activation and funnel numbers then undercount real behaviour.

Amplitude-Swift 1.19.0 (10 September 2026) adds userId and deviceId properties to Configuration. They set user and device identity at initialisation time, so identity can be present from the very first event.

Data Points to Track

  • identity_at_init: true when userId was set in Configuration
  • first_event_has_user_id: true when launch events carry a user ID
  • anonymous_launch_event_pct: launch events without a user ID
  • device_id_source: configuration, generated or restored
  • device_id_changed: true when the ID differs from the last launch
  • time_to_identity_ms: launch to identity set
  • sdk_version: Amplitude-Swift version
  • app_version: release
  • login_state: logged in or signed out at launch
  • os_version: iOS, iPadOS or macOS version

Setup Steps

  1. Measure the baseline. Count launch events that lack a user ID for logged-in users.
  2. Upgrade to 1.19.0 or later.
  3. Read stored identity early. Load the saved user ID before you build Configuration.
  4. Pass userId into Configuration for signed-in users and leave it empty for signed-out users.
  5. Pass deviceId only when you manage it yourself, and keep it stable across launches.
  6. Add an identity_at_init property to your launch event.
  7. Compare results after one release cycle.

Actionable Insights

A lower anonymous launch share means more complete user journeys. Expect activation and first-session funnels to look better, because events once attributed to nobody now belong to real users.

If device IDs change between launches, your own storage may be the cause. Setting a custom device ID is powerful and easy to get wrong, so test reinstalls and restores.

Mark the upgrade date in your dashboards. Newly attributed events raise user-level counts, and that is a data fix rather than a growth result.

Common Mistakes to Avoid

Do not pass a placeholder or empty string as user ID. Avoid setting a device ID from a value that resets on reinstall without a plan for it. And do not skip signed-out users in testing, since they are the group most likely to be mishandled.

A Simple Rollout Plan

Release to ten percent of users, compare anonymous launch events with the control group for a week, then roll out fully and note the change for analysts.

Why Launch Events Matter

Launch is when you learn how fast users reach value. Events such as app opened, home viewed and first action set the baseline for activation. If those events lose their user ID, every later metric inherits the gap. Check the first ten events of a returning session in a debug build after each release, and confirm each one carries the identity you expect.