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:

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"]
.
For your targeting to be as precise as possible, you should make sure this data is up to date by refreshing it at:
Every app start/website visit
Every time users make a change in your app/website preferences
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:

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:
Last updated
Was this helpful?