Subscriber attributes are useful for storing additional, structured information on a user. For example, you could store your user's email address and additional system identifiers directly in RevenueCat. Attributes will not be seen by your users unless you choose to explicitly show them yourself.



Subscriber attributes are only synced with RevenueCat servers when Purchases.configure() is called, app backgrounded, and when purchases are made or restored.

# Setting Attributes

Subscriber attributes can be set through the SDK by passing a dictionary of strings to the `setAttributes()` method on the shared Purchases instance.





Since subscriber attributes are writable using a [public key](🔗) they should not be used for managing secure or sensitive information such as subscription status, coins, etc.

## Restrictions

You can specify up to 50 attributes, with key names up to 40 characters long and values up to 500 characters long. Keys cannot start with `$` unless it's for one of the reserved attributes below.

**Attribute key checklist:** ✅ Key does not contain whitespace ✅ Key must start with a letter for non-reserved attributes or "$" for reserved attributes ✅ Key does not include any non-alphanumeric characters except `-` and `_` ✅ Key is not more than 40 characters ✅ Value is not more than 500 characters ✅ No more than 50 custom attributes

## Reserved attributes

Attribute keys beginning with `$` are reserved for RevenueCat. The current list of reserved keys are below:

### General

KeyDescription
`$displayName`Name that should be used to reference the user
`$apnsTokens`Apple push notification tokens for the user.
`$fcmTokens`Google push notification tokens for the user.
`$attConsentStatus`Apple App Tracking Transparency consent status for the user.
`$ipAddress`Ip Address for the user.
`$clevertapId `Clever Tap ID for the user.
`$idfa`iOS advertising identifier UUID.
`$idfv`iOS vender identifier UUID.
`$gpsAdId`The advertising ID that is provided by Google Play services.
`$androidId`Android device identifier.
`$amazonAdId`Amazon Advertising ID.
`$adjustId`The unique Adjust identifier for the user.
`$amplitudeDeviceId`The Amplitude Device ID.
`$amplitudeUserId`The Amplitude User ID.
`$appsflyerId`Appsflyer Id. The unique Appsflyer identifier for the user.
`$brazeAliasName`The Braze 'alias_name' in User Alias Object.
`$brazeAliasLabel`The Braze 'alias_label' in User Alias Object.
`$clevertapId`The CleverTap ID for the user.
`$fbAnonId`The Facebook Anonymous ID for the user.
`$attConsentStatus`Apple App Tracking Transparency consent status for the user.
`$mparticleId`The unique mParticle user identifier (mpid).
`$onesignalId`The OneSignal Player Id for the user.
`$airshipChannelId`The Airship channel ID for the user.
`$iterableUserId`The Iterable ID for the user.
`$iterableCampaignId`The Iterable campaign ID.
`$iterableTemplateId`The Iterable template ID.
`$firebaseAppInstanceId`The Firebase instance identifier.
`$mixpanelDistinctId`The Mixpanel user identifier.
`$ip`The IP address of the device.
`$email`Email address for the user.
`$phoneNumber`Phone number for the user.

attConsentStatus is populated regardless of requesting any permission

The RevenueCat SDK sends the current ATT status for the `$attConsentStatus` subscriber attribute regardless of if you are or aren't requesting any ATT permission. So just as a heads-up, you can expect to see this attribute filled.

Note: The RevenueCat SDK reads the current App Tracking Transparency Consent Status for the user, but will not modify it or request for further permission.

You may see the following as a response from this attribute:

  • `restricted` - Can be returned if the user is using a mobile device management profile that disallows some aspects of tracking regardless of consent. This might be returned even if you never ask for permissions.

  • `denied` - Can be returned if the user’s phone has set “Ask Apps Not To Track” in OS Settings or denied access for the specific app.

  • `accepted` - Returned if you ask for permission and the permission gets accepted by the user.

  • `unknown` - The user hasn’t set “Ask Apps Not to Track” in OS Settings, and you have never asked the user for consent to track activity.

### Device Identifiers

KeyDescription
`$idfa`Apple advertising identifier
`$idfv`Apple vendor identifier
`$gpsAdId`Google advertising identifier
`$androidId`Android device identifier
`$ip`IP Address

Device identifiers can't be changed once set

Once a device identifier is set for a subscriber, it can't be changed in order to keep these identifiers associated with the original installation. This allows RevenueCat to send events generated by a particular device to downstream integrations with a consistent identifier unaffected by uninstalls and reinstalls.

### Third-party Identifiers

KeyDescription
`$adjustId`[Adjust](🔗) user identifier
`$amplitudeDeviceId`[Amplitude](🔗) device identifier
`$amplitudeUserId`[Amplitude](🔗) user identifier
`$appsflyerId`[Appsflyer](🔗) user identifier
`$fbAnonId`[Facebook SDK](🔗) anonymous user identifier
`$firebaseAppInstanceId`[Firebase](🔗) instance identifier
`$iterableUserId`[Iterable](🔗) user identifier
`$mixpanelDistinctId`[Mixpanel](🔗) user identifier
`$mparticleId`[mParticle](🔗) user identifier
`$onesignalId`[OneSignal](🔗) player identifier
`$clevertapId`[CleverTap](🔗) user identifier
`$airshipChannelId`[Airship](🔗) channel identifier

### Braze User Alias Object

KeyDescription
`$brazeAliasName`Braze 'alias_name' in [User Alias Object](🔗)
`$brazeAliasLabel`Braze 'alias_label' in [User Alias Object](🔗)

### Iterable Data

Key
`$iterableCampaignId`
`$iterableTemplateId`

### Attribution Data

Key
`$mediaSource`
`$campaign`
`$adGroup`
`$ad`
`$keyword`
`$creative`



If you have access to install attribution data, you can set it using the reserved keys above. RevenueCat itself is not an attribution network and can not automatically populate this information.

Once attribution data is set for a subscriber, it can't be changed. This way attribution data can be associated with the original installation without getting overwritten.

Reserved attributes can be written directly by setting the key (don't forget the `$` prefix) or with special helper methods:



## Setting push tokens

Push tokens can be used to engage with your users through Apple apns or Google cloud messaging. These can be saved in RevenueCat through system callbacks after the user accepts the push notification permissions in your app.



# Deleting Attributes

Any attribute can be cleared by passing `null` or an empty string as the key value. Individual attributes can also be cleared for a specific user in their [customer view](🔗).



# Reading Attributes

You can access subscriber attributes through the [REST API](🔗) using a secret key, in [webhooks](🔗), and through analytics integrations ([Amplitude](🔗), [Mixpanel](🔗), [Segment](🔗)). The [customer view dashboard](🔗) will also show a list of attributes for the individual user that you can edit.





Subscriber attributes are write-only from the SDK. Reading attributes should only be done server-side through the webhooks or REST API.

Subscriber attributes are also included with transaction data for [Scheduled Data Exports](🔗).

# Next Steps

  • Enrich your app by [reacting to the user's current subscription status ](🔗)