Skip to main content

Personalized Interstitials

You can request an ad from our ad service. The wappier Optimization SDK provides you with the option to choose, if you want to draw the app completely by yourself or automatically by an AI custom view, developed by us.

Getting Tags

tip

The tag is an arbitrary string value, which is passed in the method that displays an ad or requests the respective configuration. Frequently, the tags are the different app screens, in which the end-user visits and the client requests an ad for them(e.g., HOME_SCREEN).

Below you will find how to get the available tags for your application and how these tags are used in order to display an ad in the app UI.

The wappier Optimization SDK exposes a method to get all available tags on the wappier Backend. By getting these tags you can proceed with a more dynamic/complex implementation of the personalized interstitials integration, in which in any new session the client asks for the available tags and use them to display an ad. However, this dynamic implementation is optional and it is feasible to have static tags in the client, which are used to show an ad.

You can get the available tags by calling the following method:

    Wappier.getInstance().setAdsTagListener(new AdsListener() {
@Override
public void onTags(String type, List<String> tags) {
...
}
}, Collections.singletonList(AdType.CAMPAIGN));

The available adTypes are:

CAMPAIGN for Dynamic Content Optimization Campaigns

PRICING for Global Pricing Campaigns (available soon)

LOYALTY for Loyalty&Retention Campaigns (available soon)

The available adTypes are:

CAMPAIGN for Dynamic Content Optimization Campaigns

PRICING for Global Pricing Campaigns (available soon)

LOYALTY for Loyalty & Retention Campaigns (available soon)

Creating Content Options

In order to request an ad, you need to create an instance, in which you should specify the options of the ad content. The options are the type of and the tag of the ad.

IAppOptions iAppOptions = new IAppOptions(boolean html, boolean image, String adType, String tag);
ParameterDescription
htmlHTML page (available soon)
imageImage File (available soon)
adTypeContent Instance type (e.g.,INTERSTITIAL)
tagTag which can be found in the "setAdsTagListener" callback (e.g., HOME_PAGE

Showing Dynamic Content

The wappier Optimization SDK can display dynamic content with the specified options by using the following method:

private IAdListener iAdListener = new IAdListener() {
@Override
public void onLoaded() {
...
}

@Override
public void onFailed(String error) {
...
}

@Override
public void onOpened() {
...
}

@Override
public void onClick(String action) {
...
}

@Override
public void onClosed() {
...
}
};

Wappier.getInstance().showAd(iAppOptions, iAdListener);

You can cancel the dynamic content display by calling the following method:

Wappier.getInstance().cancelAdRequest();

The wappier Optimization SDK can provide the dynamic content configuration and the client will be responsible to display the respective instance with the following method:

Wappier.getInstance().getAd(IAppOptions iAppOptions, IAdListener iAdListener, EventListener eventListener);
  • iAppOptions & iAdListener are described above

  • eventListener is a callback function to return the ad’s information

In case, the "scope" is "DEEP_LINK" and the "url" has a predefined value for specific deep links in the app, please redirect the end-user to the respective app page. A sample response can be found below:

{"type":"ON_CLICK","scope":"LINK","data":{"url":"app_xyz:\/\/open_profile"}}

Opening Loyalty User Profile

You can open the loyalty user profile through dynamic content by parsing the action message. When the user clicks on the OK button of the interstitial, the onClick() callback has a value action which is of "String" data type. So, you have to convert this "String" message to "JsonObject" using a preferred 3rd party Library. A sample response can be found below:

{"type":"ON_CLICK","scope":"DEEP_LINK","data":{"url":"wappier:\/\/loyalty"}}

Please make sure, that the "scope" is "DEEP_LINK" and the "url" within the data object starts with "wappier" as domain and "loyalty" as the path of the url.

Below can be found a Java snippet that may help you:

public void onClick(String action) {
try {
JSONObject JsonAction= new JSONObject(action);
if(JsonAction.getString("scope").equals("DEEP_LINK")){
if(JsonAction.getJSONObject("data").getString("url").equals("wappier://loyalty")){
//Call the method that shows the loyalty user profile if scope is DEEP_LINK and url contains loyalty and starts with wappier
//The respective method in unity can be found below:
//Wappier.Instance.showLoyaltyView("DCO");
Wappier.getInstance().showLoyaltyView("DCO");
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}

Opening External URLs

In case, the scope is "LINK" and the url has a value with domain "http" or "https" protocol, please open the respective URL using the device browser. A sample response can be found below:

{"type":"ON_CLICK","scope":"LINK","data":{"url":"http:\/\/www.google.com"}}

Getting User Status

You can get the end user status for each wappier service. In the response, you can find if the end-user is included in the control or target group, for the wappier service that you are asking for.

To get User Status, add the following code:

// tags is a List<String> and can take values "all" | "loyalty" | "pricing" | "campaign"
List<String> tags = new ArrayList<>();
tags.add("loyalty");
tags.add("pricing");
tags.add("campaign");

Wappier.getInstance().getUserStatus(tags, new StringListener() {
@Override
public void onSuccess(String response) {
...
}
});

which takes a list of tags as an argument and returns a JSON response as a String.

ParameterDescription
loyaltyYou will get the status of the user for the Loyalty and Retention service
pricingYou will get the status of the user for the Pricing service
campaignYou will get the status of the user for the Personalized Interstitials service
allYou will get the status of the user for all wappier services

Example Response:

"{
\"loyalty\" : {
\"population\" : 0.67220987,
\"control\" : false,
\"enabled\" : false
},
\"campaign\" : {
\"population\" : 0.36149076,
\"control\" : false,
\"enabled\" : false
},
\"pricing\" : {
\"population\" : 0.34617529,
\"control\" : false,
\"enabled\" : true,
\"globalPricing\": true,
\"personalizedPricing\": false,
\"billingCountry\": \"GR\",
\"isInScope\": true
}
}"

In the response, you may find if the user is included in the control or target group per each service.

  • If the end-user is included in the control group for the requested service if the {{service}}.control:true and {{service}}.enabled:false

  • If the end-user is included in the target group for the requested service if the {{service}}.control:false and {{service}}.enabled:true