How to implement thematic push opt-ins?

You can define different push thematics in your app/website and target your users based on their subscription preferences.

Batch allows you to target users based on their push notification preferences, as configured in your app or website. This feature is especially useful for media companies offering thematic categories (e.g., football news) or when you want to give users the option to disable specific alerts (e.g., special offers) while keeping others enabled.

1. Allow users to define their push preferences within the app or website

First, your users should be able to subscribe to one or more push categories within your app or website. This could be achieved through a dedicated screen in the account settings section of the app, for instance. Below are some examples:

Two mobile app screenshots display notification settings. The left screen, titled "Notifications," shows several thematic opt-in toggles including "Receive notifications," "Matchday Ticker," "News," "FC Bayern.tv," "Votings," and "Shop." The right screen, titled "Push notifications," presents toggles for various activity-based notifications such as "When one of my items sells" and "When members add my items to their favourites and Wish List."

2. Collect the necessary data for targeting

You need to collect your users' preferred push categories and send them to Batch using one of our data collection methods (iOS, Android, Web, Profile API). That data should be tagged as String arrays.

A user who would be subscribed to "Sports" and "Culture", for instance, would have these two values in the array push_optins = ["sports", "culture"].

3. Send notifications

To exploit the previously collected data in your push campaign targeting:

a. When creating a campaign from the dashboard

When creating a campaign on the dashboard, you can add a condition in the targeting section of the form and select the previously tagged Array in the available custom data. You can then add the different push opt-in categories that you want to target, as shown below:

 The image shows the "Segmentation" interface in Batch dashboard with three dropdown menus and an input field. The first dropdown contains the array name "suggestion_topics", the second "values" and the third "contains any of." The input field contains two tags: "menswear" and "fashion," with an "x" icon next to each for removal, and a larger "x" icon to the far right, to clear the entire input.

b. When sending a message through our Campaigns API

If you are sending your campaign via our Campaigns API, you will need to specify that in the targeting object of the call. To target users who are subscribed to "Sports" and "Culture", for example, you would have the following values in the targeting object:

"targeting": { 
  "query" : { 
    "t.push_optins": { 
      "$contains": [ "sports", "culture" ] 
    } 
  }
}

Last updated

Was this helpful?