Skip to main content

Overview

By default, SpendOwl uses an anonymous device ID to track attribution and purchases. When you set a user ID, all events are associated with that user, enabling:
  • User-level ROAS analysis
  • Cohort tracking across devices
  • Accurate LTV calculation

Setting User ID

Call setUserId() after the user logs in or registers:

Clearing User ID

Call clearUserId() when the user logs out:

Best Practices

Use your internal database ID or UUID, not email addresses or usernames which can change.
Set the user ID as soon as authentication succeeds. Clear it immediately on logout.
Set the user ID when restoring a session from keychain/token:

Anonymous ID Behavior

When no user ID is set, SpendOwl uses an anonymous ID:
  • Generated on first launch
  • Stored securely in Keychain
  • Persists across app reinstalls (if Keychain is preserved)
  • Replaced by user ID when setUserId() is called

User ID in Attribution

The user ID is included with attribution data:

User ID in Purchases

Purchases are automatically tagged with the current user ID:
If the user ID changes during a purchase, the ID at transaction time is used.

Multiple Accounts

If your app supports multiple accounts:

Privacy Considerations

  • User IDs are transmitted securely over HTTPS
  • IDs are hashed before storage in SpendOwl’s database
  • You can request user data deletion through the dashboard

Next Steps

Purchase Tracking

Learn about automatic purchase tracking

Privacy

Privacy manifest and compliance