Product documentation and training for Shipcode.
Managing User Attributes

Overview

User attributes are arbitrary key/value pairs that are associated with a user profile and sent to the Flagship™ API.

 

Examples of attributes are "gender": "male" or "age": 35. It's up to the individual app developers to determine what attributes are sent; Flagship does not prescribe key names or required attributes.

Important Guidelines

Please keep the following in mind for user attributes:

  • Attributes in a user profile are merged. You don't need to provide all attributes every time. Only send what's changed.
  • Newer values for an attribute will replace older ones.
  • An attribute can be unset by passing a null value.
  • Attributes are not case-sensitive.

 

You may update user attributes at any point in your app's lifecycle. Updating a user attribute will cause any Feeds currently displayed to update. If you need to set multiple attributes, it's best to do it once rather than calling the setter multiple times.

 

Setting User Attributes

Android

FlagshipService.getShared().setUserAttributes(mapOf(
"gender" to "male",
"age" to 35,
// To remove an attribute, pass null
attributeToRemove to null
))

iOS

FlagshipService.shared.userAttributes = [
"gender": "male",
"age": 35,
// To remove an attribute, pass nil
attributeToRemove: nil
]

React Native

// Use the FlagshipService component returned from initializing Flagship
FlagshipService.userAttributes = {
gender: 'male',
age: 35,
// To remove an attribute, pass null
attributeToRemove: null
};

 

Privacy Note

Note: User profiles are solely used for the personalization of content within your app and are never shared with third parties.

However, if you aggregate user profile information from other sources or share profile information with data brokers, you may be required to ask permission to track the user prior to establishing a user profile.

If a user opts out of tracking, simply do not set a User ID or any user attributes; only anonymous attributes will be available for personalization for that user.

See Privacy Considerations for more information.

Did this answer your question?