Experience Module Android SDK Integration

Experience Module Android SDK Integration

Android SDK

Dengage Android SDK for sending visitor behavior and rendering product recommendations.


Supports Android 4.4 and higher devices.


Important warning

ProductView, Basket Add/Remove, View Basket, Purchase and Click events must match productId.

Introduction

This tutorial provides a very simple and quick introduction to the Dengage integration for Android applications by walking you through details of different events.

To see sample application using Android SDK, please check Android SDK repository.

Integration

This guide will help you to integrate different events (visitor actions) and also product recommendations.


Event Types

Dengage uses different event types for different visitor actions. You can define following events by using Dengage Android SDK:

EventDescriptionEvent Name
PageIt is sent when a visitor views a page.PAGE_VIEW
ProductIt is sent when a visitor views a product.PRODUCT_VIEW
BasketIt is sent when a visitor makes a basket action (add product to basket or remove product from basket).BASKET_OPERATIONS
CheckoutIt is sent when a visitor makes a checkout action (views basket, enter customer information, enter payment information, finishes purchase)CHECKOUT
UserIt is sent when a visitor makes a user action or use this event to update information about customers.USER_OPERATIONS
CustomIt is sent when to identify any visitor action that has no predefined value in Dengage.CUSTOM_EVENT
InteractionIt is sent when a visitor makes an interaction like click, view a widget, submit, etc.INTERACTION
SearchIt is sent when a visitor makes a search action like clicking a search input or typing words on the search input.SEARCH

API Errors

If your request body has a field statusCode, then you have an error in your request. Details of errors are given in below table:

Error CodeDescription
NO_API_KEYYour request doesn't have an apiKey parameter, please provide apiKey parameter at the request with your account's unique api key.
NO_ACCOUNT Given api key is not associated with a Dengage account, please check your api key value.
UNVERIFIED_ACCOUNTAccount associated with api key is not a verified account. To verify your account, please check your email and verify it.
FAILED_ACCOUNTAccount associated with api key is not an active account. Please contact with support team to re-activate your account.
NO_DOMAIN_APIKEY_MATCHEach Dengage account is associated with a domain. Please check your domain and provide at requests with header Origin. Check Reqeust Details for required headers.
UNVERIFIED_ACCOUNTAccount associated with api key is not a verified account. To verify your account, please check your email and verify it.
NO_EVENTThere is no events inside request body. You should add at least one event with each request.
NO_USERIDEach Dengage event should have an userId parameter, and at least one event in the request lacks this parameter.
NO_SESSIONIDEach Dengage event should have an sessionId parameter, and at least one event in the request lacks this parameter.
BAD_INPUTYour request body should be a json array of Dengage events. It is malformed, please check your json object for validity.

Common Parameters

Every event in Dengage shares common parameters and you can add these parameters to all events that will be defined later.

Details of common parameters for events are given below:

NameTypeDescriptionExample
Event
(name)
MandatoryName of the event. Use one name from Event Types'PAGE_VIEW' or 'CHECKOUT'
User ID
(userId)
MandatoryUnique id of the user. Please check User & Session Management for creating unique key for the user/visitor. You should send same key for every event of same user and this id must be unique among other users'USER_1234567890'
Session ID
(sessionId)
MandatoryUnique id of the user session. Please check User & Session Management for creating unique key for the user/visitor session. You should send same key for every event of same user session and this id must be unique among other sessions'SESSION_1234567890'
Language
(lang)
OptionalType of current visitor's language.Contact us for other languages.
Default languages :
- 'TR'
- 'EN'
- 'FR'
- 'DE'
'FR'
Region
(region)
OptionalType of current visitor's region.'EU'
Currency
(currency)
OptionalCurrency of product price. Must be in Short Format. If not given, account's currency will be used for the product
'EUR'
Page Url
(pageUrl)
OptionalUrl of the current page which the event is generated'https://www.exampleshop.com/example-product-1/'
Test Mode
(testMode)
OptionalTest Mode Flag. If event is set to test mode, it will be only processed by campaigns in test mode and discarded in reports. Possible values are 'true' or 'false''false'

Basic Configuration

Dengage accounts have two important system variables used in integration: APP KEY and Data Center. You can access these values from Integrations menu of Dengage Panel:

System VariableDescription
App Keyunique Dengage key value to send events
Data Centerdata center end point to send dengage events

To access Integrations menu of Dengage Panel, please login to your Dengage account and navigate to Settings > Integrations.

You can do it with an extended class from the application class as follows. (We recommend it)

package xxx;

import android.app.Application;
import  com.segmentify.segmentifyandroidsdk.SegmentifyManager;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        //SegmentifyManager.INSTANCE.config(this,apiKey,dataCenter,domain);
        SegmentifyManager.INSTANCE.config(this,"xxx-xxx-xxxx-xxxx-xxxxx","https://xxxx.segmentify.com","xxxx.com");
    }
}

You should add this class in AndroidManifest.xml

  android:name=".MyApplication"

You can use the following command to set new configs

SegmentifyManager.INSTANCE.setConfig("newApiKey","newDataCenterUrl","newDomain");

Basic response method for spesific event;

SegmentifyManager.INSTANCE.sendPageView(
  "Home Page", 
  null, 
  new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {
      // parse recommendation results and render to the webpage
    }
  }
);

Callback returns as a one-dimensional array. Optional operation on the array can be done to show it in the UI. Widget View is used when the page's widget is actually displayed. Related title: Interaction

SegmentifyManager.INSTANCE.sendPageView(
  "Home Page", 
  null, 
  new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {
      // parse recommendation results and render to the webpage

      // check if recommendations are active for this page 
      // and there is recommendations to be rendered
      if(data != null) {
        // loop through each recommendation
        for (int i = 0; i < data.size(); i++) {
          RecommendationModel recommendationMdl = data.get(i);

          // check for a specific campaign
          if(recommendationMdl.getInstanceId() == "scn_XXXXXXXXXXX") {
            // render recommendations
            ArrayList<ProductRecommendationModel> products = 
              recommendationMdl.getProducts();
          }
        }
      }
    }
  }
);

Page View

When a visitor views a view controller, this event should be sent.

Parameters can be sent with page view event is given below (you can also add common parameters):

NameTypeRequirementDescriptionExample
Category
(category)
StringMandatoryCategory of the Page. Predefined values for Dengage are:
- Home Page
- Product Page
- Category Page
- Basket Page
- Checkout Page
- Search Page
- 404 Page
'Product Page'
Sub Category
(subCategory)
StringOptionalSub-category of the page. It is used to enhance information about product and category pages.
Example: For a sports category listing page, page category should be 'Category Page' and sub category should be 'Men>Shoes>Sports'
 'Men>Shoes>Sports'

An example Page View request is given below:

//define page model object
PageModel model = new PageModel();
model.setCategory("Home Page");

//send page view request 
SegmentifyManager.INSTANCE.sendPageView(model, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
  @Override
  public void onDataLoaded(ArrayList<RecommendationModel> data) {
  }
});

An example of parameterized use as an alternative;

//send page view request 
SegmentifyManager.INSTANCE.sendPageView("Home Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
  @Override
  public void onDataLoaded(ArrayList<RecommendationModel> data) {

  }
});

Search View

When a visitor wants to search products, this event should be sent.

There are two search type before search input and after search input. Before search input module works until the search is done. After search input starts working after searching. These recommendations are updated after minimum characters written in the search bar. Minimum character count presents in the campaign that is in search request response.

Parameters can be sent with search event is given below (you can also add common parameters):

NameTypeRequirementDescriptionExample
Query
(query)
StringOptionalTyped words for searching products. Should be empty or null for before search.'Dress'

An example search view request is given below:

//define search page model object
SearchPageModel searchPage = new SearchPageModel();
searchPage.setQuery("Dress");

//send search page view request 
SegmentifyManager.INSTANCE.sendSearchPageView(searchPage, new SegmentifyCallback<SearchResponseModel>() {
    @Override
    public void onDataLoaded(SearchResponseModel data) {
    }
});

Search Response Details

SearchModel has two objects: products for product list, and campaign for search campaign details.

SearchModel

NameTypeDescription
campaign
SearchCampaignModel?search campaign details.
products
ProductRecommendationModel?Product list

SearchCampaignModel

NameTypeDescription
instanceId
String?Campaign instanceId. It will be used on events.
name
String?Campaign name.
mobileItemCount
Int?Max product count to be displayed
minCharacterCount
Int?The minimum number of characters required to search
stringSearchAssetTextMap
[String:SearchAssetTextModel]language based map of titles
SEARCHASSETTEXTMODEL
NameTypeDescription
popularProductsText
String?title for popular products on cold start.
mobileCancelText
String?title for cancel button.
notFoundText
String?title for no result.

Product View

When a visitor views a product, this event should be sent.

If product is also inside a page, don't forget to send a page view event with category 'Product Page' and subCategory product's category too.

Parameters can be sent with product view event is given below (you can also add common parameters):

NameTypeRequirementDescriptionExample
Product ID
(productId)
StringMandatoryUnique id of the product'EXAMPLE_PRODUCT_1'
Title
(title)
StringMandatoryName/Title of the product 'EXAMPLE PRODUCT'
Stock
(inStock)
BoolOptionalProduct’s stock status - either true or false. If not given it is assumed to be in stock ('true')'true'
Url
(url)
StringMandatoryCanonical url of the product'https://www.exampleshop.com/example-product-1/'
Mobile Url
(mUrl)
String Optionalmobile specific url for the product'https://m.exampleshop.com/example-product-1/'
Image
(image)
StringMandatorymain image url to be used in product recommendations'https://cdn.exampleshop.com/example-product-1.png'
Image X-Small
(imageXS)
StringOptionalvery small image url to be used in product recommendations'https://cdn.exampleshop.com/example-product-1-xs.png'
Image Small
(imageS)
StringOptionalsmall image url to be used in product recommendations'https://cdn.exampleshop.com/example-product-1-small.png'
Image Medium
(imageM)
StringOptionalmedium image url to be used in product recommendations'https://cdn.exampleshop.com/example-product-1-medium.png'
Image Large
(imageL)
StringOptionallarge image url to be used in product recommendations'https://cdn.exampleshop.com/example-product-1-large.png'
Image X-Large
(imageXL)
StringOptionalvery large image url to be used in product recommendations'https://cdn.exampleshop.com/example-product-1-xl.png'
Category
(category)
StringMandatoryHierarchical category of the product'Men > Sports > Shoes'
Brand
(brand)
StringOptionalBrand of the product'EXAMPLE BRAND'
Price
(price)
NSNumber MandatoryPrice of the product, must be numeric349.99
Old/Sales Price
(oldPrice)
NSNumberOptionalPrice of the product before sales449.99
Currency
(currency)
String OptionalCurrency of product price. Must be in Short Format. If not given, account's currency will be used for the product'EUR'
Gender
(gender)
OptionalGender of the product. Possible values are 'M', 'F', 'U''M'
Colors
(colors)
Array type StringOptionalDifferent color options of the product. Must be in array format['black', 'red', 'blue']
Sizes
(sizes)
Array type String Optional Different size options of the product. Must be in array format['small', 'medium', 'large']
Labels
(labels)
Array type StringOptionalCustom labels associated with the product. You can use these labels to filter products in the recommendations. Must be in array format['top-seller', 'new-comer']
noUpdate
(noUpdate)
BoolOptionalnoUpdate must be defined as "true" in order not to disturb the products.'true'

An example product view request is given below:

//define page model object
PageModel model = new PageModel();
model.setCategory("Product Page");
model.setLang("EN");
model.setRegion("EU");

//send page view request 
SegmentifyManager.INSTANCE.sendPageView(model, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
  @Override
  public void onDataLoaded(ArrayList<RecommendationModel> data) {
  }
});

//define product model object
ProductModel model = new ProductModel();
ArrayList<String> categories = new ArrayList<String>();
categories.add("Womenswear");

model.setProductId("25799860937");
model.setCategories(categories);
model.setPrice(578.00);
model.setTitle("Asymmetric Dress in Black");
model.setImage("//cdn.shopify.com/s/files/1/1524/5822/products/2014_11_17_Lana_Look034_02_300x300.jpg?v=1475497696");
model.setUrl("https://Segmentify-shop.myshopify.com/products/asymmetric-dress-black");

//send product view request 
SegmentifyManager.INSTANCE.sendProductView(model, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

An example of parameterized use as an alternative;

//send page view request 
SegmentifyManager.INSTANCE.sendPageView("Product Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
  @Override
  public void onDataLoaded(ArrayList<RecommendationModel> data) {

  }
});

ProductModel model = new ProductModel();
ArrayList<String> categories = new ArrayList<String>();
categories.add("Womenswear");

SegmentifyManager.INSTANCE.sendProductView("25799860937","Womenswear",578.00,"Asymmetric Dress in Black","//cdn.shopify.com/s/files/1/1524/5822/products/2014_11_17_Lana_Look034_02_300x300.jpg?v=1475497696",
"https://segmentify-shop.myshopify.com/products/asymmetric-dress-black")
    , new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

Basket Operations

Dengage uses basket operations as intermediary step for measuring success of recommendations throughout the conversion funnel. Basket success rate is also reported by Trendify and Bannerify to show individual performance of products, categories, brands and banners.

Basket operations are similar to page view and product view. There are two possible steps in a basket operation these are: add product to basket, remove product from basket.

Add Product to Basket

When a visitor adds a product to basket/cart, this event should be sent.

An example request is given below:

//Define basket operations model
BasketModel model = new BasketModel();
model.setStep("add");
model.setProductId("25800400265");
model.setQuantity(2);
model.setPrice(358.00);
//Send add to basket event 
SegmentifyManager.INSTANCE.sendAddOrRemoveBasket(model);

An example of parameterized use as an alternative;

//Send add to basket event 
SegmentifyManager.INSTANCE.sendAddOrRemoveBasket("add","25800400265",2,358.00);

Remove Product from Basket

When a visitor removes a product from basket/cart, this event should be sent.

An example request is given below:

//Define basket operations model
BasketModel model = new BasketModel();
model.setStep("remove");
model.setProductId("25800400265");
model.setQuantity(2);
model.setPrice(358.00);
//Send add to basket event 
SegmentifyManager.INSTANCE.sendAddOrRemoveBasket(model);

An example of parameterized use as an alternative;

SegmentifyManager.INSTANCE.sendAddOrRemoveBasket("remove","25800400265",2,358.00);

Basket Event Parameters

Parameters can be sent with basket operations event is given below (you can also add common parameters):

NameTypeRequirementDescriptionValues
Basket Step
(step)
StringMandatory Basket operation type. Can be either 'add' or 'remove' 'add'
Product ID
(productId)
StringMandatoryUnique id of the product. Must match with product ids sent with product view event'EXAMPLE_PRODUCT_1'
Price
(price)
NSNumberOptionalPrice of the product in the basket. If not given, price of the product in product catalogue will be assumed349.99
Currency
(currency)
StringOptionalCurrency of product price. Must be in Short Format. Currency of the product is used if not given 'EUR'
QuantityStringOptionalNumber of items added to basket at this operation. If not given, it is assumed 1. You can also use decimals for not integer quantities like 2.31

Checkout Operations

Dengage uses checkout operations to measure success of recommendations throughout the conversion funnel. Checkout information and steps are also used in email & personalization campaigns. Campaign, Trendify, Bannerify and Sales reports are feed from checkout information. It is essential for both analyitcs and recommendation capabilities to function properly.

Dengage track four different steps of checkout operation:

Operation StepDetails
View BasketbasketWhen customer views the basket page. Some online stores has dedicated basket pages, others have basket detail pop-ups. For both use cases we recommend you to send checkout event with basket details. To see details, please click
Customer InformationcustomerThis is the second step on checkout funnel. When customer is entering his personal information details, this event should be send to Dengage. To see details, please click
Payment InformationpaymentWhen customer is on payment stage of checkout funnel, you should send this event to Dengage.To see details, please click
Purchase/SuccesspurchaseFinal step of checkout funnel is purchase and Dengage uses this step as success indicator for recommendations. Reports for campaigns (both recommendation and engagement), sales analysis and real-time analtyics are dependent to this event and shoukd be implemented with great care. To see details, please click

View Basket

View Basket is the first step of checkout funnel, and followed by Customer Information.

When a visitor views his/her basket/cart, this event should be sent with basket details.

An example request is given below:

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Basket Page", null, new SgmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");

productList.add(productModel);

CheckoutModel checkoutModel = new CheckoutModel();
checkoutModel.setProductList(productList);
checkoutModel.setTotalPrice(156.0);

SegmentifyManager.INSTANCE.sendViewBasket(checkoutModel, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Basket View Request

An example of parameterized use as an alternative;

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Basket Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");
productList.add(productModel);

SegmentifyManager.INSTANCE.sendViewBasket(156.00,productList,null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

//END Basket View Request

Customer Information

Customer Information is the second step of checkout funnel, and preceeded by View Basket & followed by Payment Information.

When a visitor enters customer information as second step of checkout funnel, this event should be sent with basket details.

An example request is given below:

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Customer Info Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");

productList.add(productModel);


CheckoutModel checkoutModel = new CheckoutModel();
checkoutModel.setProductList(productList);
checkoutModel.setTotalPrice(156.0);

SegmentifyManager.INSTANCE.sendCustomerInformation(checkoutModel, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Basket View Request

An example of parameterized use as an alternative;

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Customer Info Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");
productList.add(productModel);

SegmentifyManager.INSTANCE.sendCustomerInformation(156.00,productList,null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

//END Basket View Request

Please refer to View Basket Step of Checkout for basket products detail and use the same information throughout the purchase funnel by only changing step information.

Payment Information

Payment Information is the third step of checkout funnel, and preceeded by Payment Information & followed by Purchase/Success.

When a visitor enters payment information as third step of checkout funnel, this event should be sent with basket details.

An example request is given below:

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Checkout Payment Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");
productList.add(productModel);

CheckoutModel checkoutModel = new CheckoutModel();
checkoutModel.setProductList(productList);
checkoutModel.setTotalPrice(156.0);

SegmentifyManager.INSTANCE.sendPaymentInformation(checkoutModel, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Basket View Request

An example of parameterized use as an alternative;

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Checkout Payment Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");
productList.add(productModel);

SegmentifyManager.INSTANCE.sendPaymentInformation(156.00,productList,null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

//END Basket View Request

Please refer to View Basket Step of Checkout for basket products detail and use the same information throughout the purchase funnel by only changing step information.

Purchase/Success

Purchase/Success is the fourth and final step of checkout funnel, and preceeded by Payment Information.

When a visitor finalizes a purchase, this event should be sent with basket details.

An example request is given below:

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Checkout Success Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");

productList.add(productModel);

CheckoutModel checkoutModel = new CheckoutModel();
checkoutModel.setProductList(productList);
checkoutModel.setTotalPrice(156.0);
checkoutModel.orderNo("order1");

SegmentifyManager.INSTANCE.sendPurchase(checkoutModel, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Basket View Request

An example of parameterized use as an alternative;

//START Page view request
SegmentifyManager.INSTANCE.sendPageView("Checkout Success Page", null, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});
//END Page view request

//START Basket View Request
ArrayList<ProductModel> productList = new ArrayList<>();
ProductModel productModel = new ProductModel();
productModel.setPrice(78.0);
productModel.setQuantity(2);
productModel.setProductId("25799809929");
productList.add(productModel);

SegmentifyManager.INSTANCE.sendPurchase(156.00,productList,"OrderNo1", new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

//END Basket View Request

Please refer to View Basket Step of Checkout for basket products detail and use the same information throughout the purchase funnel by only changing step information.

Checkout Parameters

Detailed explanation for each parameter is given below:

NameTypeDescriptionExample
Checkout Step
(step)
StringMandatoryIdentifies which step of the checkout funnel. Each step has different meaning and use it accordingly
Total Price/Amount
(totalPrice)
NSNumberMandatoryTotal amount of the basket including taxes, shipping costs and also discounts
Currency
(currency)
StringOptionalCurrency of the total amount of the basket. Must be in Short Format. If not given, currency of the account is used
Order No
(orderNo)
StringOptionalYour unique id of the order. Send this value only for purchase/succeess step and you can access to this id on sales report
Cart Url
(cartUrl)
StringOptionalPermalink for accessing basket at later stages. Should be used for view basket, customer information and payment information steps of checkout. This url can be used at engagement campaigns like cart abondonment reminders. Customers will be informed with this url with out-bound channels like email and push messages. If not given, account's default cart url will be used (which can be adjusted from account settings in panel)
ProductsArray type AnyMandatoryList of products inside the basket. Must be in array format. Details are given at product parameters

Basket Product Parameters

Each product inside the basket can be defined with following parameters. See Checkout Parameters for defining checkout operation in which basket product is also defined.

NameTypeRequirementDescriptionExample
Product ID
(productId)
StringMandatoryUnique id of the product'EXAMPLE_PRODUCT_1'
PriceNSNumberOptionalPrice of the product in the basket. If not given, price of the product in the product catalogue will be used349.99
CurrencyStringOptionalCurrency of product price. Must be in Short Format. If not given, currency of the product in the product catalogue will be used 'EUR'
QuantityStringOptionalNumber of items from current product in the basket. If not given, it is assumed to be 11

User/Visitor Operations

Dengage tracks important user operations like sign-up/register, sign-in/login, sign-out/logout and also you can share your customer's information with Dengage by sending an update event.

Important warning

The userid must be used for the unification operation on all channels in the same userId. See the success department for the web side

There are 4 possible user/visitor operations:

  1. User Register/Sign-up: It should be sent when a visitor signed up to your website, to see details please click
  2. User Login/Sign-in: It should be sent when a registered user logins to your website, to see details please click
  3. User Logout/Sign-out: It should be sent when a registered user logouts from your website, to see details please click
  4. User Update: It should be sent when you want to share registered user's information (ex: name, email, phone number, etc.) with Dengage. These information can be used at campagin templates to customize message or email address is used for email out-bound campaigns like abandoned cart reminders. To see details please click

New User

When a visitor registers (sign-up) to your website, you should send a new user event.

If you want to share details of an already registered user with Dengage, please use User Update.

Details of parameters of new user is given below:

NameTypeRequirementDescriptionExample
User Operation
(step)
StringMandatoryIdentifies which operation is taken for current user/customer. Each operation has differen meaning and use it accordingly'signup'
Username
(username)
StringMandatoryUnique identifier for the customer'johndoe'
Full Name
(fullName)
 StringOptionalFull name of the customer. 'John Doe'
Email
(email)
 StringOptional
(Mandatory for using email module)
Email address of the customer 'john.doe@exampleshop.com'
Mobile Phone
(phone)
StringOptionalMobile phone number of the customer '+1 555 555 5555'
Is Login
(isLogin)
BoolOptionalLogin information of the usertrue
Is Registered
(isRegistered)
BoolOptionalRegister information of the customertrue
Gender
(gender)
StringOptionalGender of the customer. Must be either 'M' or 'F' 'M'
Age
(age)
StringOptionalAge of the customer. Must be numeric. Either use age or birthdate 27
Birthdate
(birthdate)
StringOptionalBirthdate of the customer. Must be in format 'DD.MM.YYYY'. Either use age or birthdate '23.01.1980'
Membership Date
(memberSince)
StringOptionalMembership date of the customer. Must be in format 'DD.MM.YYYY' '20.01.2014'
Location
(location)
StringOptionalLocation of the customer 'New York'
Customer Segments
(segments)
Array type StringOptionalSegments of the customer. Must be in array format ['SEGMENT 1', 'SEGMENT 2']

An example request is given below:

//Create new user Object
UserModel userModel = new UserModel();
//Define user object's username and email 
userModel.setUsername("Segmentify");
userModel.setEmail("example@Segmentify.com");
//Send user register request

SegmentifyManager.INSTANCE.sendUserRegister(userModel);

An example of parameterized use as an alternative;

//Send user register request
SegmentifyManager.INSTANCE.sendUserRegister("Segmentify","example@Segmentify.com");

User Login

When a registered customer logins (sign-in), a user login event should be sent to Dengage.

Details of parameters of user login is given below:

NameTypeRequirementDescriptionExample
User Operation
(step)
StringMandatoryIdentifies which operation is taken for current user/customer'signin'
UsernameStringMandatoryUnique identifier for the customer'johndoe'

An example request is given below:

//Create new user Object
UserModel userModel = new UserModel();
//Define user object's username and email 
userModel.setUsername("Segmentify");
userModel.setEmail("example@Segmentify.com");
//Send user register request

SegmentifyManager.INSTANCE.sendUserLogin(userModel);

An example of parameterized use as an alternative;

//Send user login request
SegmentifyManager.sharedManager().sendUserLogin("Segmentify","example@segmentify.com")

User Logout

When a registered customer logouts (sign-out), a user logout event should be sent to Dengage.

Details of parameters of user logout is given below:

NameTypeRequirementDescriptionExample
User Operation
(step)
StringMandatoryIdentifies which operation is taken for current user/customer'signout'
UsernameStringMandatoryUnique identifier for the customer'johndoe'

An example request is given below:

//Create new user Object
UserModel userModel = new UserModel();
//Define user object's username and email 
userModel.setUsername("Segmentify");
userModel.setEmail("example@segmentify.com");
//Send user register request

SegmentifyManager.INSTANCE.sendUserLogout(userModel);

An example of parameterized use as an alternative;

//Send user login request
SegmentifyManager.sharedManager().sendUserLogout("Segmentify","example@segmentify.com")

User Update

When you want to share an already registered customer information, provide details of the customer by sending an user update event. You can use both this integration for both frequently updating user information and instant updates when customer updates his/her personal information.

If you want to share a new registered user with Dengage, please use New User.

Details of parameters of user update is given below:

NameTypeRequirementDescriptionExample
User Operation
(step)
StringMandatoryIdentifies which operation is taken for current user/customer. Each operation has differen meaning and use it accordingly'update'
Username
(username)
StringMandatoryUnique identifier for the customer'johndoe'
Full Name
(fullName)
StringOptionalFull name of the customer. 'John Doe'
Email
(email)
StringOptional
(Mandatory for using email module)
Email address of the customer 'john.doe@exampleshop.com'
Mobile Phone
(phone)
 StringOptionalMobile phone number of the customer '+1 555 555 5555'
Gender
(gender)
StringOptionalGender of the customer. Must be either 'M' or 'F' 'M'
Age
(age)
StringOptionalAge of the customer. Must be numeric. Either use age or birthdate 27
Birthdate
(birthdate)
StringOptionalBirthdate of the customer. Must be in format 'DD.MM.YYYY'. Either use age or birthdate '23.01.1980'
Membership Date
(memberSince)
StringOptionalMembership date of the customer. Must be in format 'DD.MM.YYYY' '20.01.2014'
Location
(location)
StringOptionalLocation of the customer 'New York'
Customer Segments
(segments)
Array type StringOptionalSegments of the customer. Must be in array format [ 'SEGMENT 1', 'SEGMENT 2' ]
Is Registered Flag
(isRegistered)
BoolOptionalThis is an advanced parameter, use cautiously. If you want to change user's register status without sending a register event, use this flag. Value is either 'true' or 'false''true'
Is Login Flag
(isLogin)
BoolOptionalThis is an advanced parameter, use cautiously. If you want to change user's login status without sending a login/logout event, use this flag. Value is either 'true' or 'false''true'

An example request is given below:

//Create new user Object
UserModel userModel = new UserModel();
//Define user object's username and email 
userModel.setUsername("Segmentify");
userModel.setEmail("example@segmentify.com");
//Send user register request

SegmentifyManager.INSTANCE.sendUserUpdate(userModel);

An example of parameterized use as an alternative;

//Send user update request
SegmentifyManager.sharedManager().sendUserUpdate("Segmentify","example@segmentify.com")

User Change

This event is used when userid wants to be changed.

UserChangeModel model = new UserChangeModel();
model.setUserId("XXXXXXXXXX");

SegmentifyManager.INSTANCE.sendChangeUser(model;

Custom Event

This integration enables any event & data important for you to be tracked by Dengage and become actionable. With this integration, you can send any non standard events & data to Dengage, and gives endless opportunities to track and take actions to your visitor's behaviour.

Details of parameters of custom event is given below:

NameTypeRequirementDescriptionExample
Type
(type)
StringMandatoryType of the event. You should use same type for same events'my_custom_event'
Custom Parameters
(params)
DictionaryOptionalCustom parameters of the event. Must be in map format.'{"field1":"value1", "field2":"value2"}'

An example request is given below:

CustomEventModel model = new CustomEventModel();
model.setType("test");

SegmentifyManager.INSTANCE.sendCustomEvent(model, new SegmentifyCallback<ArrayList<RecommendationModel>>() {
    @Override
    public void onDataLoaded(ArrayList<RecommendationModel> data) {

    }
});

Interaction

Dengage needs to be thrown to use the information from widgets.

Widget View

Widget View is used when the page's widget is actually displayed.

NameTypeRequirementDescriptionExample
instanceId
StringMandatoryIdentity of the campaignscn_6186a632e0d76001
interactionId
StringMandatoryIdentity of the actionact_6185c1e624ab0000
if(recObj.instanceId == "scn_xxx") { // recObj is the recomendationModel object returned from the productView event.
    //Any actions related to product's
    var interactionId  = recObj.interactionId
    var instanceId = recObj.instanceId
    SegmentifyManager.INSTANCE.sendWidgetView(instanceId,interactionId:interactionId);
} 

Click

It is necessary to notify the product productId and which campaign it belongs to when it is clicked on a product in any recommendation.

NameTypeRequirementDescriptionExample
instanceId
StringMandatoryIdentity of the campaigninstanceId = "scn_6186a632e0d76001"
interactionId
StringMandatoryUnique id of the productinteractionId = "25803234569"
if(recObj.instanceId == "scn_xxx") { // recObj is the recomendationModel object returned from the productView event.
    //Any actions related to product's
    var interactionId  = productId
    var instanceId = recObj.instanceId
    SegmentifyManager.INSTANCE.sendClick(instanceId,interactionId:interactionId);
} 

Search Click

It is necessary to notify the productId when it is clicked on a product in any search result.

If identity of the campaign in search response is "BEFORE_SEARCH" then instanceId should be bs_product.

NameTypeRequirementDescriptionExample
instanceId
StringMandatoryIdentity of the product for before search inputinstanceId = "bs_product"
interactionId
StringMandatoryUnique id of the product for before search inputinteractionId = "123456789"

If identity of the campaign in search response is "SEARCH" then instanceId should be product.

NameTypeRequirementDescriptionExample
instanceId
StringMandatoryIdentity of the product for after search inputinstanceId = "product"
interactionId
StringMandatoryUnique id of the product for after search inputinteractionId = "123456789"
SegmentifyManager.INSTANCE.sendSearchClickView("product","123456789");

Banners

Event Types and Definitions

EventDescriptionEvent Name
Banner OperationsEvents that should be sent when there is an interaction with the banner. It can be an impression, a click to the banner, or an update for banner information.BANNER_OPERATIONS
Banner Group ViewEvent that needs to be sent for the banner group uploaded to the page.BANNER_GROUP_VIEW
Internal Banner GroupThe event that feeds the active banner status in the relevant group and the information of these banners to the Dengage.INTERNAL_BANNER_GROUP

Parameters can be sent with banner operations event is given below (you can also add common parameters):

NameTypeRequirementDescriptionExample
Type
(type)
StringMandatoryBanner operation type. Can be 'impression', 'click' or 'update''impression'
Title
(title)
StringMandatoryTitle of the banner'Home Page Banner'
Group
(group)
StringMandatoryGroup of the banner'Home Page Banner - Group 1'
Order
(url)
NSNumber MandatoryOrder of the banner in the group1
Product ID
(productId)
String OptionalUnique id of the product'EXAMPLE_PRODUCT_1'
Category
(category)
StringOptionalHierarchical category of the product'Men > Sports > Shoes'
Brand
(brand)
StringOptionalBrand of the product'EXAMPLE BRAND'
Label
(label)
StringOptionalCustom label associated with the banner.'top-seller'
// Banner impression event
BannerOperationsModel bannerImpressionOperationModel = new BannerOperationsModel();
bannerImpressionOperationModel.setBannerType("impression");
bannerImpressionOperationModel.setTitle("New Season Men Shoes");
bannerImpressionOperationModel.setGroup("Home Page Slider");
bannerImpressionOperationModel.setOrder(1);
SegmentifyManager.INSTANCE.sendBannerImpressionEvent(bannerImpressionOperationModel);

// Banner click event
BannerOperationsModel bannerClickOperationModel = new BannerOperationsModel();
bannerClickOperationModel.setBannerType("click");
bannerClickOperationModel.setTitle("New Season Women Shoes");
bannerClickOperationModel.setGroup("Home Page Slider");
bannerClickOperationModel.setOrder(2);
SegmentifyManager.INSTANCE.sendBannerClickEvent(bannerClickOperationModel);

// Banner update event
BannerOperationsModel bannerUpdateOperationModel = new BannerOperationsModel();
bannerUpdateOperationModel.setBannerType("update");
bannerUpdateOperationModel.setTitle("New Season Women Shoes");
bannerUpdateOperationModel.setGroup("Home Page Slider");
bannerUpdateOperationModel.setOrder(3);
SegmentifyManager.INSTANCE.sendBannerUpdateEvent(bannerUpdateOperationModel);

Parameters can be sent with banner group view event is given below (you can also add common parameters):

NameTypeRequirementDescriptionExample
Group
(group)
StringMandatoryGroup of the banner'Home Page Banner - Group 1'
// Banner Group View Model
BannerGroupViewModel bannerGroupViewModel = new BannerGroupViewModel();
bannerGroupViewModel.setGroup("Home Page Slider");
// optional parameters
ArrayList<InternalBannerModel> internalBannerModels = new ArrayList<>();
InternalBannerModel internalBannerModel = new InternalBannerModel();
internalBannerModel.setTitle("Gorgeous Duo T-Shirt & Trousers");
internalBannerModel.setOrder(1);
internalBannerModel.setImage("https://www.example.com/gorgeous-duo-tshirt-trousers.jpg");
internalBannerModel.setUrls(new ArrayList<>(Arrays.asList("https://www.example.com/gorgeous-duo-tshirt-trousers")));
internalBannerModels.add(internalBannerModel);

internalBannerModel = new InternalBannerModel();
internalBannerModel.setTitle("Ready to Renew");
internalBannerModel.setOrder(2);
internalBannerModel.setImage("https://www.example.com/ready-to-renew.jpg");
internalBannerModel.setUrls(new ArrayList<>(Arrays.asList("https://www.example.com/ready-to-renew")));
internalBannerModels.add(internalBannerModel);
bannerGroupViewModel.setBanners(internalBannerModels);
// optional parameters end

SegmentifyManager.INSTANCE.sendBannerGroupViewEvent(bannerGroupViewModel);

Internal Banner Group

Parameters can be sent with banner group view event is given below (you can also add common parameters):

NameTypeRequirementDescriptionExample
Group
(group)
StringMandatoryGroup of the banner'Home Page Banner - Group 1'
Banners
(banners)
Array type AnyOptionalList of banners. Must be in array format. Details are given at banner details[banner1,banner2]
NameTypeRequirementDescriptionExample
Title
(title)
StringOptionalTitle of the banner'Home Page Banner'
Image
(image)
StringOptionalImage of the banner'https://example.com/image.jpg'
Order
(url)
NSNumber OptionalOrder of the banner1
Urls
(urls)
Array type AnyOptionalUrls of the banner[https://example.com/banner1]
BannerGroupViewModel bannerGroupViewModel = new BannerGroupViewModel();
bannerGroupViewModel.setGroup("Home Page Slider");
ArrayList<InternalBannerModel> internalBannerModels = new ArrayList<>();
InternalBannerModel internalBannerModel = new InternalBannerModel();
internalBannerModel.setTitle("Gorgeous Duo T-Shirt & Trousers");
internalBannerModel.setOrder(1);
internalBannerModel.setImage("https://www.example.com/gorgeous-duo-tshirt-trousers.jpg");
internalBannerModel.setUrls(new ArrayList<>(Arrays.asList("https://www.example.com/gorgeous-duo-tshirt-trousers")));
internalBannerModels.add(internalBannerModel);

internalBannerModel = new InternalBannerModel();
internalBannerModel.setTitle("Ready to Renew");
internalBannerModel.setOrder(2);
internalBannerModel.setImage("https://www.example.com/ready-to-renew.jpg");
internalBannerModel.setUrls(new ArrayList<>(Arrays.asList("https://www.example.com/ready-to-renew")));
internalBannerModels.add(internalBannerModel);
bannerGroupViewModel.setBanners(internalBannerModels);

segmentifyManager.INSTANCE.sendInternalBannerGroupEvent(bannerGroupViewModel);


    • Related Articles

    • Experience Module Integration For Mobile App

      Mobile App Integration ​ Segmentify can integrate with any mobile application and has following alternatives: iOS SDK: You can connect your iOS app to Dengage Experience Module by using native iOS SDK Android SDK: You can connect your Android app ...
    • Experience Module iOS SDK Integration

      iOS SDK¶ Dengage iOS SDK for sending visitor behavior and rendering product recommendations. Important warning ProductView, Basket Add/Remove, View Basket, Purchase and Click events must match productId. Introduction¶ This tutorial provides a very ...
    • Experience Module Custom Mobile Integration

      Custom Integration¶ Custom Integration (Backend Side) Guide and Restful API Beta This integration method is in beta and not recommended for frontend use. Please check other integration methods. Introduction¶ This tutorial provides a very simple and ...
    • Where can I see latest SDK version?

      The following link provides where the documentation is available for the SDK version. You can use the following links relevant to the technologies to see the required SDK version. IOS SDK Android SDK Huawei SDK React Native Cordova Flutter
    • D·engage GTM Integration

      There are two different ways for GTM integration. You can create new google tags as well as, you can use existing ones. (a) Using Existing Tags for Sending Events Data In order to use your existing triggers to send data to the D·engage platform you ...