Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The existence of a relevant in-app message for an event controlled by after each customEvent call. You can create and customize your in-app messages on https://intelligence.relateddigital.com/#Target/TargetingAction/TAList page of RMC administration panel.

There are 8 9 types of in-app messages:

Pop-up - Image, Header, Text & Button

Mini-icon&text

Full Screen-image

Image Modified

Image Modified

Image Modified

Full Screen-image&button

Pop-up - Image, Header, Text & Button

Pop-up-Survey

Image Modified

Image Modified

Image Modified

Pop-up - NPS with Text & Button

Native Alert & Action Sheet

NPS with Numbers

Image Modified

Image Modified

Image Added

NPS & Second Popup

Video In-App

Image AddedImage Added

...

ZoneID is different for each application, so contact RMC team for support. Suggestion widgets such as "Alternative Products" require the product code to be seen as a parameter.

The specification of After the request is completed, the callback function is as followscalled depending on the success or failure of the request, so you need to code the callback functions according to your needs as shown below:

Code Block
languagejava

...

VisilabsTargetRequest targetRequest = Visilabs.CallAPI().buildTargetRequest(zoneID, "productCode");
targetRequest.executeAsync(callback);

...

languagejava

...

VisilabsCallback callback = new 

...

VisilabsCallback()

...

 

...

{

...

 

...

 

...

 

...

After the request is completed, the callback function is called depending on the success or failure of the request, so you need to code the callback functions according to your needs as shown below:

...

languagejava

...

 @Override
    public void success(VisilabsResponse response) {
        try{
            JSONObject jsonObject = response.getJson();
            String groupTitle = jsonObject.getString("title");
            JSONArray jsonArray = jsonObject.getJSONArray("recommendations");
            for(int i = 0 ; i < 

...

jsonArray.length() ; i++) {
                JSONObject 

...

currentProductObject = 

...

jsonArray.getJSONObject(i);

...

                String currentProductTitle = currentProductObject.getString("

...

title"

...

);

...


                Double currentProductPrice = currentProductObject.getDouble("price");
                boolean currentProductFreeShipping = currentProductObject.getBoolean("freeshipping");
                String qs = currentProductObject.getString("qs");
                //Continues like this...
            }
        } catch (Exception e){
            Log.e(LOG_TAG, e.getMessage(), e);
        }
    }
    @Override
    public void fail(VisilabsResponse response) {
        Log.e(LOG_TAG, response.getErrorMessage());
    }
};

After creating the callback function as above, the request is thrown as follows:

Code Block
languagejava
VisilabsTargetRequest targetRequest = Visilabs.CallAPI().buildTargetRequest(zoneID, "productCode");
targetRequest.executeAsync(callback);

There is also an overload buildTargetRequest method where you can pass filters and additional parameters.

Code Block
languagejava
List<VisilabsTargetFilter> filters = new ArrayList<VisilabsTargetFilter>();
HashMap<String,String> properties = new HashMap<String, String>();
properties.put("OM.extra", "Extra Value");
VisilabsTargetFilter f = new VisilabsTargetFilter("attr1", "0", "value");
filters.add(f);
f.setAttribute("attr2");
f.setFilterType("1"); // There are 2 filter types: Include and Exclude. For Include pass "0", for Exclude pass "1".
f.setValue("value");
filters.add(f);

try {
    VisilabsTargetRequest targetRequest = Visilabs.CallAPI().buildTargetRequest(zoneID, "productCode", properties, filters);
    targetRequest.executeAsync(callback);
} catch (Exception e) {
    e.printStackTrace();

In order for Recommendation clicks to be reflected on the panel, the following method should be called with the "qs" parameter of the clicked product.

Code Block
// In the example callback function, you can see how the "qs" parameter can be obtained for each product.
Visilabs.CallAPI().trackRecommendationClick(qs);

...

Code Block
languagejava
customEvent(String pageName, HashMap<String, String> properties, Activity parent)

...

Spin to Win

After form is created at RMC panel, likewise in-app message, existence of spin to win is controlled by after each customEvent call. It is shown as follows. You need to call overload, which takes Activity in the customEvent parameter. Sample code and visual;

Code Block
languagejava
customEvent(String pageName, HashMap<String, String> properties, Activity parent)

Spin to Win Full

Spin to Win Half

Image AddedImage Added

Scratch to Win

After form is created at RMC panel, likewise in-app message, existence of Scratch to Win is controlled by after each customEvent call. It is shown as follows. You need to call overload, which takes Activity in the customEvent parameter. Sample code and visual;

Code Block
languagejava
customEvent(String pageName, HashMap<String, String> properties, Activity parent)

...

Product Stat Notifier

The Product Stat Notifier action that you define in the RMC Panel works in Product View, Add to Cart and Add/Remove Favorites events. When you send these events, you must make sure that the product id is sent. The customEvent method you call in these events should take the Activity overload.

...

Drawer

After a drawer action is created at RMC panel, likewise in-app message, existence of a Drawer action is controlled after each customEvent call. You need to call the method with Activity parameter. Sample code and visual;

Code Block
customEvent(String pageName, HashMap<String, String> properties, Activity parent)

 

...