Mobile: What Is The Campaign Trigger API and How Is It Used?
Brief Overview
In addition to static triggers, Campaigns can be triggered by a unique API call integrated into the app.
The API trigger is useful for activating Campaigns by an action performed in your app, such as a button tap or a screen transition. For example, if there is nothing in the app to key a segment off of, you can set an API trigger to precisely determine the moment when a Campaign will start.
Enabling the API Trigger in the Mobile Console
The API trigger requires setting a key with which the Campaign will use to start, which can be done in the Campaign Wizard's REVIEW & PUBLISH tab.
Click on the API trigger:
and enter the API key:
How To Integrate API Triggers With Your App
Android
Trigger a campaign without redirect
ABBI.trigger("my-key");
Trigger a campaign after redirecting the user to a deeplink in the app
ABBI.trigger("my-key","myapp://deep_link");
iOS
Trigger a campaign without redirect
[ABBI trigger:@"my-key"];
Trigger a campaign after redirecting the user to a deeplink in the app
[ABBI trigger:@"my-key" withDeepLink:@"myapp://deep_link"];