AnalyticsiOS Setup
User Identity
Associate events with users and set user properties.
Set a user ID
Associate events with a specific user. Call this after the user signs in.
AppPanel.shared.setUserId("user_123")Set user properties
Use the shorthand to set properties directly:
AppPanel.shared.identify(userProperties: [
"plan": "pro",
"company": "Acme Inc"
])Identify builder
For more control, use the Identify builder:
let identify = Identify()
.set(property: "plan", value: "pro")
.setOnce(property: "signup_date", value: "2025-01-01")
.add(property: "login_count", value: 1)
AppPanel.shared.identify(identify)Available operations
| Operation | Description |
|---|---|
set | Set the value of a property |
setOnce | Set a value only if the property hasn't been set before |
add | Increment a numeric property |
append | Append a value to a list property |
prepend | Prepend a value to a list property |
preInsert | Insert at the beginning of a list, only if not already present |
postInsert | Insert at the end of a list, only if not already present |
remove | Remove a value from a list property |
unset | Remove a property entirely |
clearAll | Remove all user properties |
Clear user data
When a user signs out:
AppPanel.shared.reset()This clears the user ID, user properties, and resets the device context.