User Identification
Identify users to track their activity and deliver personalized messages:Event Tracking
Track custom events:Screen Tracking
Track screen views manually:screen from .onAppear (see Platform-Specific Guides).
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
User identification, event tracking, and core SDK features for iOS.
import ZixflowDataPipelines
// Identify user with ID only
Zixflow.shared.identify(userId: "user@example.com")
// Identify user with additional attributes
Zixflow.shared.identify(
userId: "user@example.com",
traits: [
"first_name": "John",
"last_name": "Doe",
"email": "user@example.com",
"plan": "premium"
]
)
let anonymousId = Zixflow.shared.anonymousId
let userId = Zixflow.shared.userId
// Simple event
Zixflow.shared.track(name: "Button Clicked")
// Event with properties
Zixflow.shared.track(
name: "Product Purchased",
properties: [
"product_id": "123",
"product_name": "Widget",
"price": 29.99,
"currency": "USD"
]
)
Zixflow.shared.screen(
title: "Product Detail",
properties: [
"product_id": "123",
"category": "Electronics"
]
)
// Optional category overload
Zixflow.shared.screen(title: "Checkout", category: "Commerce")
let config = SDKConfigBuilder(apiKey: "YOUR_API_KEY")
.autoTrackUIKitScreenViews()
.build()
screen from .onAppear (see Platform-Specific Guides).
Zixflow.shared.setProfileAttributes([
"age": 30,
"subscription_status": "active"
])
Zixflow.shared.setDeviceAttributes([
"store_region": "us-west",
"preferred_language": "en"
])
Zixflow.shared.alias(newId: "new-user-id")
// Clear the identified user (also deletes the device token from the profile)
Zixflow.shared.clearIdentify()
// Full analytics reset (traits, userId, anonymousId)
Zixflow.shared.reset()
Zixflow.shared.flush {
print("Flush completed")
}
if let deviceToken = Zixflow.shared.registeredDeviceToken {
print("Device token: \(deviceToken)")
} else {
print("Device token not yet registered")
}