Using custom attributes [BETA]

Overview

This topic explains what custom attributes are and how to use them.

App Upgrade allows you to target app versions based on arbitrary custom attributes, which means you can control who gets upgrade popup based on any criteria that you define.

Use case

  • Targetting app versions based on android or ios platform version.
  • Targetting app versions based on country.
  • Targetting app versions based on user group such as beta, premium.
  • Targetting app versions based on app build number.
  • and many more.

Adding custom attributes

First add custom attributes in SDK. You must first add custom attributes within SDK before you can use them in targeting version.

Or if you have integrated App Upgrade with your app using API make sure you send custom attributes in API.

React Native SDK Example:

  const xApiKey = "MDNmNmZkNDEtNmNkMi00NzY3LThjOWEtYWYxMGFjZWQ0ZjI2";
  const appInfo = {
    appId: 'com.android.com'
    appName: 'Wallpaper app',
    appVersion: '1.0.0',
    platform: 'android',
    environment: 'production',

    // Custom Attributes
    customAttributes: {
        os-version: 12, // os version for example android 12 or ios 15
        user-country: 'US', // User's country
        user-group: 'beta' // User's group
    }
  };

  appUpgradeVersionCheck(appInfo, xApiKey, alertConfig);

?> Custom attributes are only available for React Native SDK version >= 1.0.7

API Example:

{
    "app_name": "Wallpaper app",
    "app_version": "1.0.0",
    "platform": "android",
    "environment": "production,
    "customAttributes": {
        "os-version": 12, // os version for example android 12 or ios 15
        "user-country": 'US', // User's country
        "user-group": 'beta' // User's group
    }
}

Targetting based on custom attributes

Make sure that you have added the custom attributes to be send from your app either via SDK or API integration method. Head over to App Upgrade dashboard and create a new version to target users based on custom attributes.

Create new version.

Create a new version by providing the details for the built-in attributes and your custom attributes. Here we are providing following custom attributes:

  • os-version: 12
  • user-group: beta

To target the app versions which are running app on android os 12 and are in beta user group.

custom-attributes-create

This will show the upgrade poupup to the app versions who are running app on android os 12 and are in beta user group.

Similarly if you only want to target app versions who are in user-group beta you can just create version with custom attribute user-group beta.

How custom attributes are evaluated?

App Upgrade uses a evaluation mechanism to show the upgrade popup to app versions based on criteria. The built-in attributes (app name, app version, platform, environment) are evaluated first.

  • If you have not set any custom attributes in version. The built-in attributes are evaluated to make decision.
  • If you have set any custom attributes than built-in with custom attributes are evaluated to make decision.

Consider there are there apps running and sending the following data to the app upgrade.

app 1 - no custom attributes are being sent.

{
    "app_name": "Wallpaper app",
    "app_version": "1.0.0",
    "platform": "android",
    "environment": "production
}

app 2 - one custom attribute is being sent.

{
    "app_name": "Wallpaper app",
    "app_version": "1.0.0",
    "platform": "android",
    "environment": "production,
    "customAttributes": {
        "os-version": 12
    }
}

app 3 - multple custom attributes are being sent.

{
    "app_name": "Wallpaper app",
    "app_version": "1.0.0",
    "platform": "android",
    "environment": "production,
    "customAttributes": {
        "os-version": 12,
        "user-group": 'beta'
    }
}

Let's create a version in dashboard with the following parameters without any custom attributes:

"app_name": "Wallpaper app"
"app_version": "1.0.0",
"platform": "android",
"environment": "production,

This version will target app 1, app 2 and app 3 and show upgrade popup.

custom-attributes-target-builtin

If you want to target app 2 and app 3 which has custom attributes os-version: 12 You will need to create a version with custom attribues os-version: 12 in dashboard.

"app_name": "Wallpaper app"
"app_version": "1.0.0",
"platform": "android",
"environment": "production,
"customAttributes": {
    "os-version": 12
}

This version will target app 2 and app 3. custom-attributes-target-single

If you want to dig deep and target only app 3 which targets users running os-version 12 and are in user-group beta you can add one more custom attribute while creating version.

custom-attributes-create

?> Custom attributes are evaluated in AND fashion, so the following custom attributes will be translated into os-version=12 and user-group=beta

    "customAttributes": {
        "os-version": 12,
        "user-group": 'beta'
    }

SDK Support

List of minimum SDK versions with custom attribute support.

SDK Version
Android 1.0.5
Flutter 2.0.1
Expo 1.0.16
iOS (Swift) 1.0.5
React Native 1.0.16

Follow the documentation of respective SDKs for more details and usages guidelines.

Custom Attribute via API

In case if you have not integrated SDK and using our API. Please follow this page for guidelines.

© 2022-2023 | App Upgrade | All Rights Reserved            Updated 2023-10-23 19:34:58

results matching ""

    powered by algolia

    No results matching ""