plan or location. The
dashboard filters and groups users by it, and remote configuration reads it to pick a value for
the user. Analytics Web sets it with setProperty. Grain Tag has no method for user properties.
Set a property
identify or login, or
the anonymous ID. The properties stay on the user until a later call overwrites them. Read
Identify users.
Set a property when a user signs up and when the value changes.
Values
Every value becomes a string before the SDK sends it. Compare a property as a string when you read it.Set properties for another user
TheuserId option sends the properties to a user other than the current one.
Properties in remote configuration
Remote configuration segments a user by properties. Pass the same properties in theproperties
option of getConfigAsync, and the response holds the value for that segment.
Limits
To store more than four properties, make more than one call.
Failures
setProperty returns a promise. The promise resolves after the request, and it does not reject
on a failure. The SDK logs the failure on the console instead.
React
useGrainAnalytics returns the client. Call setProperty on it.
Rules for the client
- Identify the user before you set properties. Otherwise the properties go to the anonymous ID.
- Set a property when its value changes, not on every page load.
- Use the same key in
setPropertyand in thepropertiesoption of remote configuration. The segment matches on the key. - Send only properties that the user consented to. Read Privacy and consent.