Skip to main content
User properties are attributes you can set on a user level. You can send user properties to third-party platforms and use them in Qonversion for customer segmentation and analytics. Here is an example of user properties:

Usage

There are two types of user properties: Qonversion-defined and custom user properties.

Defined User Properties

We defined some common case properties and provided API for adding them:
Qonversion.shared().setUserProperty(.email, value: "me@qonversion.io")
The full list of the defined properties is provided below:
NameKeyDescription
Email\_q_emailUser Email. It can be used for cross-platform authorization and integrations with Qonversion.
Name\_q_nameUser Name
KochavaDeviceId\_q_kochava_device_idKochava Unique Device ID
AppsFlyerUserId\_q_appsflyer_user_idCustomer user ID. It can be used to cross-reference your in-house data with AppsFlyer attribution data.
AdjustAdId\_q_adjust_adidAdjust Advertising ID
CustomUserId\_q_custom_user_idYour Internal User ID. Use User ID for third-party Integrations to attribute events to existing users in other platforms.
FacebookAttribution\_q_fb_attributionMobile Cookie from the user’s device
FirebaseAppInstanceId\_q_firebase_instance_idThe identifier for a Firebase app
AppSetId\_q_app_set_idUnique user identifier for all the developer’s applications on Android
AdvertisingId\_q_advertising_idUnique user identifier assigned to a mobile device on iOS
PushWooshUserId\_q_pushwoosh_user_idUnique user identifier assigned to Pushwoosh. Used for Pushwoosh integration.
PushWooshHwId\_q_pushwoosh_hwidHardware identifier generated by Pushwoosh. Used for Pushwoosh integration.
AppMetricaDeviceId\_q_appmetrica_device_idDevice identifier from AppMetrica. Used for AppMetrica integration.
AppMetricalProfileId\_q_appmetrica_user_profile_idUser profile identifier from AppMetrica. Used for AppMetrica integration.

Custom User Properties

Additionally, you can add custom user property. Qonversion can send them to third-party integrations as well. For example, you can add user details and use that data to send personalized emails or push notifications via Mailchimp and OneSignal integrations.
Qonversion.shared().setCustomUserProperty("liked-app", value: "yes")
You can use letters A-Za-z, numbers, and the following symbols _.:- as a property key.

Property setting order

To successfully set either Defined or Custom User Properties, launch Qonversion SDK first. Learn more.

Get User Properties

You can get user properties set for a current user as follows:
Qonversion.shared().userProperties({ userProperties, error in
  if let error = error {
    // Handle error
    return
  }

  userProperties?.properties.forEach({ userProperty in
    print("User property: ", "key: ", userProperty.key, ", value: ", userProperty.value)
  })
});
The object returned by userProperties method contains several utility fields and methods:
Qonversion.shared().userProperties({ userProperties, error in
  ...
  // List of all user properties
  let allProperties = userProperties?.properties

  // Subset of all user properties, which were set using Qonversion-defined keys
  let definedProperties = userProperties?.definedProperties

  // Subset of all user properties, which were set using custom keys
  let customProperties = userProperties?.customProperties

  // A flattened version of all user properties as a key-value map
  let flatPropertiesMap = userProperties?.flatPropertiesMap

  // A flattened version of defined user properties as a key-value map
  let flatDefinedPropertiesMap = userProperties?.flatDefinedPropertiesMap

  // A flattened version of custom user properties as a key-value map
  let flatCustomPropertiesMap = userProperties?.flatCustomPropertiesMap

  // Searches for a property with the given property key in all properties list
  let customProperty = userProperties?.property(for: "customKey")

  // Searches for a property with the given Qonversion-defined property key in the defined properties list.
  let emailProperty = userProperties?.definedProperty(for: .email)
});

(Optional) Set User ID

If you want to implement cross-platform (Android, IOS, and Web) user entitlement management, please, follow the User Identity guide. To match Qonversion revenue events to users in third-party tools, you need to set the identical user IDs in all of them:
Qonversion.shared().setUserProperty(.userID, value: "yourSideUserId")
The user ID improves the quality of events matching to the platforms where event attribution is not exclusively based on IDFA or GAID.

(Optional) Set IDFA (Identifier for Advertisers, iOS 14.5+ only)

On iOS 14.5+, after requesting the app tracking permission using ATT, you need to notify Qonversion if tracking is allowed and IDFA is available. This will help to have precise attribution in Adjust, AppsFlyer, Singular and other Qonversion integrations.
ATTrackingManager.requestTrackingAuthorization { status in
    switch status {
    case .authorized:
        Qonversion.shared().collectAdvertisingId()

    // handle other states below
    }
}

(Optional) Set ASID (App set ID, Android 12+ only)

On Android 12+, you can provide an App set ID to have it used in Qonversion integrations. Add com.google.android.gms:play-services-appset as the dependency to your project and write the following code.
final AppSetIdClient client = AppSet.getClient(context);
final Task<AppSetIdInfo> task = client.getAppSetIdInfo();
task.addOnSuccessListener(info -> {
    final String id = info.getId();
    Qonversion.getSharedInstance().setUserProperty(QUserPropertyKey.AppSetId, id);
});

Web SDK Server Notifications