setUserAttributes()
Sets custom attributes for the current user that can be used in campaign targeting.
User attributes are key-value pairs that help you target campaigns to specific user segments. They're also sent with events for analytics.
Purpose
Sets custom attributes for the current user that can be used for campaign targeting and analytics.
Signature
Parameters
Name | Type | Description |
---|---|---|
userAttributes | Map<String, Object> | A map of user attributes to set. Values can be strings, numbers, booleans, or dates. |
Returns / State
Returns a Future<void>
that completes when the user attributes are set.
Usage
Basic usage:
After user signup:
Updating subscription info:
With error handling:
How is this guide?