With our iOS SDK and Android SDK we have also released the capability to target a specific subgroup of your app users.

The system is very flexible and can be used for multiple use cases. Here is a list of examples:

  • Send a notification to all logged in users of my app
  • Send a notification to all users of my app who have a score above 1000
  • Send a notification to all users who have specified their hometown to be Warsaw

From a data privacy perspective, we designed the feature in a way so that data is only stored on the client. We are providing a new API in the SDKs the enable customers to set any String key values which filters the campaigns for the current app user. Here an example which can be used in your application:

Android


        Map<String, String> attributes = sdk.getAttributes();
        if (userMananger.userloggedIn) {
            attributes.put("user_LoggedIn", "true");
            attributes.put("user_hometown", userMananger.getHomeTown());
        }
        attributes.put("score", "above1000");
        sdk.setAttributes(attributes);

IOS

NSDictionary *attributes = @{ @"userLoggedIn":@YES,  
                              @"userHomeTown":@"Warsaw"};  
[[SBManager sharedManager] setTargetAttributes:attributes];  

To clear the attributes pass a nil: [[SBManager sharedManager] setTargetAttributes:nil]

Notes:

You are responsible for keeping the attributes in sync. If the user logs out, make sure to clear the attributes and send them to the SDK again. If you don´t clear the attributes, they remain unchanged in the SDK.

Panel use

To create a targetted campaign simply expand “Advanced Campaign Settings” options located in the General section of your campaign. Entering key and its value will result in campaign reaching only these users which have these values set. For example - below campaign will only target users marked as logged in. User Targetting

For your convienience the value field supports regex. For example fields filled as below will target all users whose birthday is any date in August.

User Targetting

Important!

Please note that targeted campaigns still need triggers! In the above example the logged in user needs to enter the geofence/beacon/wifi region to get the notification.