# How to create a re-optin campaign to improve my opt-in rate? (MEP)

{% hint style="info" %}
This guide is specific to Batch's Mobile Engagement Platform (More on the [difference between Batch's CEP and MEP](/getting-started/other/faq/what-are-the-differences-between-batch-customer-engagement-platform-and-mobile-engagement-platform.md)).
{% endhint %}

## Understanding iOS & Android push permission <a href="#h_0a512d63da" id="h_0a512d63da"></a>

On iOS and Android 13 and higher, users must give their consent to receive push notifications from your app (or "*opt-in"*). Users who didn't see the push permission prompt or refused to receive push notifications are considered "*opt-out*".

<figure><img src="/files/gui1yGP561WrHSU4BCF0" alt=""><figcaption><p>Native opt-in premission prompt on iOS and Android.</p></figcaption></figure>

iOS and Android push permission prompts are similar:

* On iOS, the permission prompt **can only be displayed once**. On Android, users can tap in the grey area to dismiss the permission prompt. It will be displayed again the next time users will open the app.
* The wording of the push permission prompts **cannot be customized**.
* Developers **can choose when** the permission prompt is triggered (e.g., after a pre-permission screen, as part of the onboarding tutorial, presenting why you are asking users to turn on push notifications. Read this [Guide on how to improve your opt-in rate](https://help.batch.com/en/articles/4195576-how-to-improve-the-push-opt-in-rate)).
* Users who do not allow push notifications cannot trigger the push permission prompt again later. They need to **go to the system settings** to grant the push permission for your app.
* On Android, the system (via Play Protect) will **automatically revoke** the push permission for long-time dormant users.

## Creating a re-opt-in automation using In-App messages <a href="#h_1ca2f54ca1" id="h_1ca2f54ca1"></a>

Getting opt-out users to turn on push notifications is key to re-engaging your audience, especially in the first 7 days following the app install. This can be done in a couple of minutes using an In-App message.

**Batch In-App Messages** are a powerful tool to encourage opt-out users to enable push notifications. These In-App automations allow you to efficiently invite such users back by suggesting they turn on notifications. With Batch's advanced targeting and personalization features, you can display these messages at the right moment and context, following a meaningful action.

* **Media**: When users reach the end of an article, share or save an article, create or log into their account, get a premium subscription, etc.
* **Retail:** When users add an item to their wish list, add a favorite brand, or after the checkout, to be sure they get alerts on their delivery.
* Etc.

### Pre-requisites <a href="#h_7a28b41001" id="h_7a28b41001"></a>

Here is the list of prerequisites for setting up your opt-in automation:

* **SDK**: On Android, make sure your app includes the 1.19.2 version of Batch SDK (or higher). Your Android app must also target, at least, Android 13 (API 33). Install the latest version of your app and find your install in the debug tool (Settings → Debug) to check the current version of Batch's SDK used in your app.
* **Tagging plan:** Make sure all the user actions you plan on using as triggers for your In-App message are tagged as events with Batch's SDK. On Batch's dashboard, go to Profiles → Custom Data → Events (or Settings → Custom Data → Events if you are using our Mobile Engagement Platform)  to check the list of events available as trigger events. If the action needed is missing, your developers will need to tag it following Batch documentation: [iOS](https://doc.batch.com/developer/sdk/ios/profile-data/events) / [Android](https://doc.batch.com/developer/sdk/android/profile-data/events) / [Cordova](https://doc.batch.com/developer/sdk/cordova/profile-data/events) / [Flutter](https://doc.batch.com/developer/sdk/flutter/profile-data/events) / [React Native](https://doc.batch.com/developer/sdk/react-native/profile-data/events).

<figure><img src="/files/gcyR1EwyYBFcp8rbwo3o" alt=""><figcaption><p>Several events displayed in Profiles > Custom Data in Batch's dashboard.</p></figcaption></figure>

## Automation creation <a href="#h_5f10c53fc3" id="h_5f10c53fc3"></a>

You will need to create an In-App automation using the following instructions:

### 1. Targeting

Add the "Push opted-in" condition to your targeting and set it to "No" to target exclusively users who did not turn on notifications. We recommend you turn on the "*Re-evaluate targeting just before display*" option to improve your In-App automation behavior.

<figure><img src="/files/m1qRvXxOUAMf77j12NH1" alt=""><figcaption><p>How to target opt-out users.</p></figcaption></figure>

On Android, make sure you add a condition to target exclusively Android 13 (and higher) users:

<figure><img src="/files/gIDTQQGUextyMN2ggRT2" alt=""><figcaption><p>How to target opt-out users on Android.</p></figcaption></figure>

### 2. Trigger conditions

Here is where you choose when the re-opt-in automation will be triggered:

* **Display event:** We recommend using a custom event linked to a specific action sent to Batch through your tagging plan. Select an event triggered after an engaging action from the user: signing up or logging in to your app, adding an item to the cart, etc.
* **Capping:** This feature helps you to control marketing pressure. In the example below, we have set a capping of 2 and a 72 hours grace period. A user will see the In-App message 2 times maximum, with a delay of 3 days minimum.

<figure><img src="/files/7MVBe7u04YomYGttLdiy" alt=""><figcaption><p>How to trigger your In-App.</p></figcaption></figure>

{% hint style="danger" %}
"NEW SESSION" triggers the display of the In-App when the app is opened. However, this display event is not ideal: when using this trigger, the re-evaluation of targeting is inoperative.

Even if you enable re-targeting, the user will see the In-App message at least a second time, even after turning opt-in.
{% endhint %}

### 3. Message edition

Then, edit your message:

1. **Select the In-App theme** you want to use, in the format adapted for your use case (e.g., banner, modal, full screen, image, or webview). If you do not have a theme yet, create one from Settings → Theme → New theme.
2. **Add wording** for the text and the buttons of your message, according to your theme.
3. **Configure the button action**: Choose the "Smart push re-optin" option as the primary action. You can add another action for advanced use cases (e.g., track an event when users click "later" to show them another In-App message later.)

<figure><img src="/files/AzCfDhNNnOxlzoLryuWC" alt=""><figcaption><p>How to compose your re-optin In-App.</p></figcaption></figure>

Clicking a button linked to the "Smart push re-optin" action will have different outcomes based on your users.

* **If users never triggered the push permission prompt,** → Batch will trigger the push permission prompt, allowing users to turn on push notifications.
* **If users have already triggered the push permission prompt and didn't turn on notifications** → Batch will direct users to the system settings, in the section dedicated to your app, where users will be able to turn on push notifications.

<figure><img src="/files/hR4EF1VFgUvfH1sp2yqP" alt=""><figcaption><p>How does re-optin work?</p></figcaption></figure>

### 4. Testing the automation

To test a re-opt-in automation, your installation has to be opt-out. In this state, you can’t receive the test push via the Send a test feature. That’s why you need to[ create a Custom Audience](https://doc.batch.com/getting-started/features/mobile-engagement-platform/settings/app-settings#creating-a-custom-audience) with your Installation ID (See the guides for [iOS](https://help.batch.com/en/articles/4687256-how-can-i-find-my-installation-id-on-an-ios-device) and [Android](https://help.batch.com/en/articles/7956556-how-can-i-find-my-installation-id-on-an-android-device)).

Once your Custom Audience is ready and attached to your test automation, you can activate it.

<figure><img src="/files/XL2LLkFqudFUORN1RECL" alt=""><figcaption><p>How to target a Custom Audience.</p></figcaption></figure>

{% hint style="info" %}
Make sure that your Installation matches the targeting rules. You can check it in the **Settings > Debug** page of the dashboard. You might also turn off the **capping** and the **Grace period** when running multiple tests.
{% endhint %}

Then, you can trigger the display event of your In-App automation, and you must see your In-App message, and you can click on the buttons.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.batch.com/guides-and-best-practices/orchestration/how-to-create-a-re-optin-campaign-to-improve-my-opt-in-rate-mep.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
