In the Swrve SDKs, message display rules for an in-app message campaign work as expected under normal circumstances. However, there are some scenarios where a small number of users may see a campaign more than once.
The SDK stores the in-app message display rules in a cache file on the user’s device. Some reasons why a message may be displayed more than once are:
- The cache file gets cleared.
- It is not possible to read the message limits from the cache file.
- It is not possible to write to the cache file.
To avoid this, you can add an audience filter to the campaign to ensure the message is only displayed for users who have not seen it before. This method is effective as it removes a user from the campaign audience, rather than relying solely on message display rules.
There are two main steps involved in adding the audience filter to your in-app message campaign:
- Create and launch the campaign.
- Pause the campaign, add an audience filter, and relaunch.
Create and launch the campaign
Step 1: For new campaigns, create the in-app message as normal (for more information, see Creating in-app messages). For existing campaigns, if you didn’t initially set campaign-level message display rules, select the campaign in the Campaigns centre, and then select Pause & Edit.
Step 2: On the Set Target screen of the campaign workflow, under the Set Display Triggers section, select Message display rules. Select the second option and enter 1 for the maximum number of times a user can receive the message.
Step 3: For existing campaigns, go to Step 2 below. For new campaigns, on the Preview & Test screen of the campaign workflow, select Launch as soon as possible. Once the campaign is Active, is it available to select in the audience builder.
Add audience filter and relaunch
Step 1: If you created a new campaign in the previous section, in the Campaigns center, select the campaign and select Pause & Edit.
Step 2: On the Set Target screen of the campaign workflow, under the Define Target Audience section, select Custom Audience. The audience builder is displayed.
Step 3: Select the Campaigns tab and in the Select In-App Messages list, select the campaign that you are currently editing.
Step 4: In the filter lists, select the options didn’t see the message, anytime, and then select Apply filter to add the filter to the campaign. Select Update: Preview & Test to save your changes.
Step 5: On the Preview & Test screen, select Relaunch. Going forward, when a user sees the message once, they are removed from the target audience and will not receive it again.