Android SDK

Segmentify 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 Segmentify 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. Integration can be divided into following steps:


Event Types

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

Event Description Event Name
Page It is sent when a visitor views a page PAGE_VIEW
Product It is sent when a visitor views a product PRODUCT_VIEW
Basket It is sent when a visitor makes a basket action (add product to basket or remove product from basket) BASKET_OPERATIONS
Checkout It is sent when a visitor makes a checkout action (views basket, enter customer information, enter payment information, finishes purchase) CHECKOUT
User It is sent when a visitor makes a user action or use this event to update information about customers USER_OPERATIONS
Custom It is sent when to identify any visitor action that has no predefined value in Segmentify CUSTOM_EVENT
Interaction It is sent when a visitor makes an interaction like click, view a widget, submit, etc. INTERACTION
Search It 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 Code Description
NO_API_KEY Your 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 Segmentify account, please check your api key value.
UNVERIFIED_ACCOUNT Account associated with api key is not a verified account. To verify your account, please check your email and verify it.
FAILED_ACCOUNT Account associated with api key is not an active account. Please contact with support team to re-activate your account.
NO_DOMAIN_APIKEY_MATCH Each Segmentify account is associated with a domain. Please check your domain and provide at requests with header Origin. Check Reqeust Details for required headers.
UNVERIFIED_ACCOUNT Account associated with api key is not a verified account. To verify your account, please check your email and verify it.
NO_EVENT There is no events inside request body. You should add at least one event with each request.
NO_USERID Each Segmentify event should have an userId parameter, and at least one event in the request lacks this parameter.
NO_SESSIONID Each Segmentify event should have an sessionId parameter, and at least one event in the request lacks this parameter.
BAD_INPUT Your request body should be a json array of Segmentify events. It is malformed, please check your json object for validity.

Common Parameters

Every event in Segmentify 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:

Name Type Description Example
Event
(name)
Mandatory Name of the event. Use one name from Event Types 'PAGE_VIEW' or 'CHECKOUT'
User ID
(userId)
Mandatory Unique 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)
Mandatory Unique 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)
Optional Type of current visitor's language.Contact us for other languages.
Default languages :
- 'TR'
- 'EN'
- 'FR'
- 'DE'
'FR'
Region
(region)
Optional Type of current visitor's region. 'EU'
Currency
(currency)
Optional Currency of product price. Must be in Short Format. If not given, account's currency will be used for the product
'EUR'
Page Url
(pageUrl)
Optional Url of the current page which the event is generated 'https://www.exampleshop.com/example-product-1/'
Test Mode
(testMode)
Optional Test 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

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

System Variable Description
App Key unique Segmentify key value to send events
Data Center data center end point to send Segmentify events

To access Integrations menu of Segmentify Panel, please login to your Segmentify 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):

Name Type Requirement Description Example
Category
(category)
String Mandatory Category of the Page. Predefined values for Segmentify are:
- Home Page
- Product Page
- Category Page
- Basket Page
- Checkout Page
- Search Page
- 404 Page
'Product Page'
Sub Category
(subCategory)
String Optional Sub-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) {

  }
});

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):

Name Type Requirement Description Example
Product ID
(productId)
String Mandatory Unique id of the product 'EXAMPLE_PRODUCT_1'
Title
(title)
String Mandatory Name/Title of the product  'EXAMPLE PRODUCT'
Stock
(inStock)
Bool Optional Product’s stock status - either true or false. If not given it is assumed to be in stock ('true') 'true'
Url
(url)
String Mandatory Canonical url of the product 'https://www.exampleshop.com/example-product-1/'
Mobile Url
(mUrl)
String  Optional mobile specific url for the product 'https://m.exampleshop.com/example-product-1/'
Image
(image)
String Mandatory main image url to be used in product recommendations 'https://cdn.exampleshop.com/example-product-1.png'
Image X-Small
(imageXS)
String Optional very small image url to be used in product recommendations 'https://cdn.exampleshop.com/example-product-1-xs.png'
Image Small
(imageS)
String Optional small image url to be used in product recommendations 'https://cdn.exampleshop.com/example-product-1-small.png'
Image Medium
(imageM)
String Optional medium image url to be used in product recommendations 'https://cdn.exampleshop.com/example-product-1-medium.png'
Image Large
(imageL)
String Optional large image url to be used in product recommendations 'https://cdn.exampleshop.com/example-product-1-large.png'
Image X-Large
(imageXL)
String Optional very large image url to be used in product recommendations 'https://cdn.exampleshop.com/example-product-1-xl.png'
Category
(category)
String Mandatory Hierarchical category of the product 'Men > Sports > Shoes'
Brand
(brand)
String Optional Brand of the product 'EXAMPLE BRAND'
Price
(price)
NSNumber  Mandatory Price of the product, must be numeric 349.99
Old/Sales Price
(oldPrice)
NSNumber Optional Price of the product before sales 449.99
Currency
(currency)
String  Optional Currency of product price. Must be in Short Format. If not given, account's currency will be used for the product 'EUR'
Gender
(gender)
Optional Gender of the product. Possible values are 'M', 'F', 'U' 'M'
Colors
(colors)
Array type String Optional Different 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 String Optional Custom 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)
Bool Optional noUpdate 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

Segmentify 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):

Name Type Requirement Description Values
Basket Step
(step)
String Mandatory  Basket operation type. Can be either 'add' or 'remove'  'add'
Product ID
(productId)
String Mandatory Unique id of the product. Must match with product ids sent with product view event 'EXAMPLE_PRODUCT_1'
Price
(price)
NSNumber Optional Price of the product in the basket. If not given, price of the product in product catalogue will be assumed 349.99
Currency
(currency)
String Optional Currency of product price. Must be in Short Format. Currency of the product is used if not given  'EUR'
Quantity String Optional Number 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.3 1

Checkout Operations

Segmentify 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.

Segmentify track four different steps of checkout operation:

Operation  Step Details
View Basket basket When 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 Information customer This is the second step on checkout funnel. When customer is entering his personal information details, this event should be send to Segmentify. To see details, please click
Payment Information payment When customer is on payment stage of checkout funnel, you should send this event to Segmentify.To see details, please click
Purchase/Success purchase Final step of checkout funnel is purchase and Segmentify 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 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.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:

Name Type Description Example
Checkout Step
(step)
String Mandatory Identifies which step of the checkout funnel. Each step has different meaning and use it accordingly
Total Price/Amount
(totalPrice)
NSNumber Mandatory Total amount of the basket including taxes, shipping costs and also discounts
Currency
(currency)
String Optional Currency of the total amount of the basket. Must be in Short Format. If not given, currency of the account is used
Order No
(orderNo)
String Optional Your 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)
String Optional Permalink 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)
Products Array type Any Mandatory List 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.

Name Type Requirement Description Example
Product ID
(productId)
String Mandatory Unique id of the product 'EXAMPLE_PRODUCT_1'
Price NSNumber Optional Price of the product in the basket. If not given, price of the product in the product catalogue will be used 349.99
Currency String Optional Currency of product price. Must be in Short Format. If not given, currency of the product in the product catalogue will be used  'EUR'
Quantity String Optional Number of items from current product in the basket. If not given, it is assumed to be 1 1

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):

Name Type Requirement Description Example
Query
(query)
String Optional Typed 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 ten objects: products for product list, campaign for search campaign details, banners for search banners, meanings for alternative word suggestions, lastSearches for user's last searched words, brands and brandProducts for brand asset, categories and categoryProducts for category asset, keywords for keyword asset.

SearchModel

Name Type Description
campaign
SearchCampaignModel? Search Campaign details.
products
[ProductRecommendationModel]? Products for product list.
banners
[SearchBannerModel]? Search banners list.
meanings
[String]? List of alternative keywords. It uses for 'did you mean' feature.
lastSearches
[String]? List of user's last searched words.
brands
String:String? Map of brand name and its tracking url. It uses for brand asset.
brandProducts
String:[ProductModel]? Map of brand name and list of its products.
categories
String:String? Map of category name and its tracking url. It uses for category asset.
categoryProducts
String:[ProductModel]? Map of category name and list of its products.
keywords
String:[ProductModel]? Map of keyword and list of its products. It uses for keyword asset.

SearchCampaignModel

Name Type Description
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
Name Type Description
popularProductsText
String? title for popular products on cold start.
mobileCancelText
String? title for cancel button.
notFoundText
String? title for no result.

Searchandising - Beta

This feature is only available on 2.1.7-beta version.

Do not forget to apply Searchandising Click integration as well.

Searchandising Model

When a visitor wants to navigate to search result page, this event should be sent.

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

Name Type Requirement Description Example
Query
(query)
String Mandatory Typed words for searching products. 'Dress'
Type
(type)
String Mandatory Search type. This parameter has only one value and must not be changed. 'faceted'
Ordering
(ordering)
Ordering? Mandatory Search result products ordering. Default value is "SMART_SORTING"
SMART_SORTING
BEST_MATCH
PRICE_DESC
PRICE_ASC
ALPHABETICAL_DESC
ALPHABETICAL_ASC
BEST_SELLERS
NEWEST
FacetedOrdering(page:1,sort:"SMART_SORTING")
Trigger
(trigger)
String Mandatory Trigger types.
keyword
filter
order
page
'keyword'
Filters
(filters)
List? Optional Filter types.
category
brand
price
var filter = [FacetedFilter]() filter.append(FacetedFilter(facet: "category", values:["Dress > Woman Dress"]))

An example search view request is given below:

//define search-facet view object
SearchFacetedPageModel facetedPageModel = new SearchFacetedPageModel();
facetedPageModel.setQuery("Dress");
facetedPageModel.setLang("EN");
facetedPageModel.setTrigger("keyword");
facetedPageModel.setType("faceted");
facetedPageModel.setOrdering(new Ordering());
List<Filter> filterList = new ArrayList<>();
filterList.add(new Filter("category",Arrays.asList("Dress > Women Dress")));
filterList.add(new Filter("brand",Arrays.asList("Dressama")));
filterList.add(new Filter("price",Arrays.asList("100-350")));
facetedPageModel.setFilters(filterList);
//send search-facet view request
SegmentifyManager.INSTANCE.sendFacetedSearchPageView(facetedPageModel, new SegmentifyCallback<SearchFacetedResponseModel>() {
    @Override
    public void onDataLoaded(SearchFacetedResponseModel data) {
        }
});

Ordering

Ordering allows you to order search result page product orders by following algorithms

Smart Sorting Products are listed by their popularity that is calculated by special algorithm.

Relevancy/Best Match Products are listed according to their search relevancy scores resulted from search term.

Price Descending Products are listed by their price values in descending order. (9-0)

Price Ascending Products are listed by their price values in ascending order. (0-9)

Alphabetical Ascending Products are listed by their name in ascending order. (A-Z)

Alphabetical Descending Products are listed by their name in descending order. (Z-A)

Best Sellers Products are listed by their purchase popularity

Newest Product are listed by their publishing date.


Trigger

Trigger allows you to get paginated results by either filter results or order changes or to get more results. Trigger usage is also explained in Searchandising Response Details Default trigger method is keyword. Any new search request must contain keyword trigger method. Sample search request;

//define search-facet view object
SearchFacetedPageModel facetedPageModel = new SearchFacetedPageModel();
facetedPageModel.setQuery("Dress");
facetedPageModel.setLang("EN");
facetedPageModel.setTrigger("keyword");
facetedPageModel.setType("faceted");
facetedPageModel.setOrdering(new Ordering());
//send search-facet view request
SegmentifyManager.INSTANCE.sendFacetedSearchPageView(facetedPageModel, new SegmentifyCallback<SearchFacetedResponseModel>() {
    @Override
    public void onDataLoaded(SearchFacetedResponseModel data) {
        }
});

If more search result page is needed then search request must contain page trigger method. Page trigger can only be used if Meta object has page.next parameter true value. Sample search request;

//define search-facet view object
SearchFacetedPageModel facetedPageModel = new SearchFacetedPageModel();
facetedPageModel.setQuery("Dress");
facetedPageModel.setLang("EN");
facetedPageModel.setTrigger("page");
facetedPageModel.setType("faceted");
facetedPageModel.setOrdering(new Ordering("SMART_SORTING",1));
//send search-facet view request
SegmentifyManager.INSTANCE.sendFacetedSearchPageView(facetedPageModel, new SegmentifyCallback<SearchFacetedResponseModel>() {
    @Override
    public void onDataLoaded(SearchFacetedResponseModel data) {
        }
});

Sample Meta object that indicates there is more result

{
  "meta": {
    "total": 118,
    "page": {
      "current": 1,
      "rows": 30,
      "prev": false,
      "next": true
    },
    "params": {
      "defaultOrder": "BEST_MATCH",
      "currentRow": 30,
      "currency": "€",
      "isCurrencyPlaceBefore": true
    }
  }
}

If a filter is used for search result page by selecting any facet items then search request must contain filter trigger method with filter object. Sample search request;

//define search-facet view object
SearchFacetedPageModel facetedPageModel = new SearchFacetedPageModel();
facetedPageModel.setQuery("Dress");
facetedPageModel.setLang("EN");
facetedPageModel.setTrigger("filter");
facetedPageModel.setType("faceted");
facetedPageModel.setOrdering(new Ordering());
List<Filter> filterList = new ArrayList<>();
filterList.add(new Filter("category",Arrays.asList("Dress > Women Dress")));
facetedPageModel.setFilters(filterList);
//send search-facet view request
SegmentifyManager.INSTANCE.sendFacetedSearchPageView(facetedPageModel, new SegmentifyCallback<SearchFacetedResponseModel>() {
    @Override
    public void onDataLoaded(SearchFacetedResponseModel data) {
        }
});

If an order is needed to be changed for search result page then search request must contain order trigger method with filter object. Sample search request;

//define search-facet view object
SearchFacetedPageModel facetedPageModel = new SearchFacetedPageModel();
facetedPageModel.setQuery("Dress");
facetedPageModel.setLang("EN");
facetedPageModel.setTrigger("order");
facetedPageModel.setType("faceted");
facetedPageModel.setOrdering(new Ordering("PRICE_DESC", 1));
List<Filter> filterList = new ArrayList<>();
filterList.add(new Filter("category",Arrays.asList("Dress > Women Dress")));
facetedPageModel.setFilters(filterList);
//send search-facet view request
SegmentifyManager.INSTANCE.sendFacetedSearchPageView(facetedPageModel, new SegmentifyCallback<SearchFacetedResponseModel>() {
    @Override
    public void onDataLoaded(SearchFacetedResponseModel data) {
        }
});

Filters

Filters allows you to get filtered results on search result page by brand, category, colors, gender, price or sizes options. Filters use facet items for filtering process. Filters usage is also explained in Searchandising Response Details

//define search-facet view object
SearchFacetedPageModel facetedPageModel = new SearchFacetedPageModel();
facetedPageModel.setQuery("Dress");
facetedPageModel.setLang("EN");
facetedPageModel.setTrigger("keyword"); 
facetedPageModel.setType("faceted");
facetedPageModel.setOrdering(new Ordering());
List<Filter> filterList = new ArrayList<>();
filterList.add(new Filter("category",Arrays.asList("Dress > Women Dress")));
filterList.add(new Filter("brand",Arrays.asList("Dressama")));
filterList.add(new Filter("price",Arrays.asList("100-350")));
filterList.add(new Filter("colors",Arrays.asList("Bronze","Black","White")));
filterList.add(new Filter("sizes",Arrays.asList("XS","S","36","38")));
facetedPageModel.setFilters(filterList);
//send search-facet view request
SegmentifyManager.INSTANCE.sendFacetedSearchPageView(facetedPageModel, new SegmentifyCallback<SearchFacetedResponseModel>() {
    @Override
    public void onDataLoaded(SearchFacetedResponseModel data) {
        }
});

Searchandising Response Details

Searchandising requests returns SearchFacetedResponseModel. This model has 7 objects: facets for customer faced filters, meta for summary information on related search result page, contents for customize search result page, banners for search banners, meanings for alternative word suggestions, products for product list, instanceId for action identity.

Name Type Description
facets
[FacetElement]? FacetElement object. Facets are customer faced filters to refine search results.
meta
Meta? Meta object. Meta object holds information summary on related search result page.
contents
[CustomContent]? Content object. This object holds custom content that can help to customize the result page. Used in web integration.
banners
[SearchBanner]? Banners list. Hold the banner list for customize search result page. Used in web integration
meanings
[String]? List of alternative keywords. It uses for 'did you mean' feature.
products
[ProductRecommendationModel]? Products for product list.
instanceId
String? Campaign instanceId. It will be used on events.

FacetElement

Name Type Description
property
String Property object. Holds the property key value; brand, category, colors, gender, price, sizes. Custom properties can also be added through Searchandising campaign.
items
[Item]? Item object. Holds the property sub values. Detailed in Item
Item
Name Type Description
value
String Value object. Holds the property key value.
count
Int Count object. Holds the count of the property object, number of count value object.

Sample Facets JSON Response

{
  "facets": [
    {
      "property": "gender",
      "items": [

      ],
      "filtered": [

      ],
      "viewMode": "picklist"
    },
    {
      "property": "sizes",
      "items": [

      ],
      "filtered": [

      ],
      "viewMode": "picklist"
    },
    {
      "property": "price",
      "items": [
        {
          "value": "24.95 - 3699.0",
          "count": 56
        }
      ],
      "filtered": [

      ],
      "viewMode": "sliding"
    },
    {
      "property": "category",
      "items": [
        {
          "value": "Tablet > Tech > Case",
          "count": 43
        },
        {
          "value": "Tablets > Tech > Computing > Tablet Cases",
          "count": 7
        },
        {
          "value": "TV > TV's by Brand > TV",
          "count": 2
        },
        {
          "value": "Tablets > Tech > Computing",
          "count": 1
        }
      ],
      "filtered": [

      ],
      "viewMode": "treeview"
    },
    {
      "property": "brand",
      "items": [
        {
          "value": "Barand1",
          "count": 40
        },
        {
          "value": "Brand2",
          "count": 1
        }
      ],
      "filtered": [

      ],
      "viewMode": "picklist"
    },
    {
      "property": "colors",
      "items": [
        {
          "value": "Black",
          "count": 4
        },
        {
          "value": "Silver",
          "count": 3
        },
        {
          "value": "Bronze",
          "count": 1
        },
        {
          "value": "Green",
          "count": 1
        },
        {
          "value": "Mystic Black",
          "count": 1
        },
        {
          "value": "Mystic Pink",
          "count": 1
        },
        {
          "value": "Mystic Silver",
          "count": 1
        },
        {
          "value": "Rose Gold",
          "count": 1
        },
        {
          "value": "White",
          "count": 1
        }
      ],
      "filtered": [

      ],
      "viewMode": "picklist"
    }
  ]
}

Meta

Name Type Description
total
Int? Total object. Count of result
page
Page? Page object. Holds the pagination information. Detailed in Page
params
MetaParams? Item object. Holds the property sub values. Detailed in MetaParams
Page
Name Type Description
current
Int? Current object. Holds the current page number.
next
Boolean? Next object. Holds the information if next page is available.
prev
Boolean? Prev object. Holds the information if previous page is available.
rows
Int? Rows object. Holds the count of pagination result count.
MetaParams
Name Type Description
defaultOrder
String? DefaultOrder object. Holds the order value, detailed in Ordering
currentRow
Boolean? CurrentRow object. Holds the current page.
currency
Boolean? Currency object. Holds the currency information. Used on web integration.
isCurrencyPlaceBefore
Int? IsCurrencyPlaceBefore object. Holds the information about currency place detail. Used on web integration.

Sample Meta JSON Response

{
  "meta": {
    "total": 56,
    "page": {
      "current": 1,
      "rows": 60,
      "prev": false,
      "next": false
    },
    "params": {
      "defaultOrder": "BEST_MATCH",
      "currentRow": 56,
      "currency": "€",
      "isCurrencyPlaceBefore": true
    }
  }
}

SearchBanner

Name Type Description
id
String Id object. Id of the banner
instanceId
String InstanceId object. Identity of the campaign
status
String Status object. Banner status. (ACTIVE/PASSIVE)
searchType
String SearchType object. Search type, banner can be also used in searchbox or searchandising campaings, with this parameter segmentify differentiates campaign type.
name
String Name object. Name of the banner.
bannerURL
String BannerURL object. Banner image url.
targetURL
String TargetURL object. Banner target url. (Used in web integration)
position
String Position object. Banner position (Used in web integration, possible values: Results Footer/Header, Filters Footer/Header).
width
String Width object. Banner width (Used in web integration).
height
String Height object. Banner height (Used in web integration).
method
String Method object. Banner method, defines banner image url upload method (Used in web integration).
newtab
String Newtab object. Banner target URL open method, either newtab or samepage (Used in web integration).

Sample Banners JSON Response

{
  "banners": [
    {
      "id": "searchb_f38af653fbd18000",
      "instanceId": "fcs_9d9d5a4bf8000",
      "status": "ACTIVE",
      "searchType": "faceted",
      "name": "Name Of The Banner",
      "bannerUrl": "https://www.example.com/examlpe.png",
      "targetUrl": "https://www.example.com/example_page.html?_sgm_campaign=searchb_f38af653fbd18000&_sgm_source=fcs_9d9d5a4bf8000%7Cbanner&_sgm_action=search&_sgm_term=term",
      "position": "FILTERS_FOOTER",
      "width": "100%",
      "height": "auto",
      "method": "URL",
      "newtab": false
    }
  ]
}

Sample Searchandising JSON response

{
  "search": [
    [
      {
        "facets": [
          {
            "property": "gender",
            "items": [

            ],
            "filtered": [

            ],
            "viewMode": "picklist"
          },
          {
            "property": "sizes",
            "items": [

            ],
            "filtered": [

            ],
            "viewMode": "picklist"
          },
          {
            "property": "price",
            "items": [
              {
                "value": "24.95 - 3699.0",
                "count": 56
              }
            ],
            "filtered": [

            ],
            "viewMode": "sliding"
          },
          {
            "property": "category",
            "items": [
              {
                "value": "Tablet > Tech > Case",
                "count": 43
              },
              {
                "value": "Tablets > Tech > Computing > Tablet Cases",
                "count": 7
              },
              {
                "value": "TV > TV's by Brand > TV",
                "count": 2
              },
              {
                "value": "Tablets > Tech > Computing",
                "count": 1
              }
            ],
            "filtered": [

            ],
            "viewMode": "treeview"
          },
          {
            "property": "brand",
            "items": [
              {
                "value": "Barand1",
                "count": 40
              },
              {
                "value": "Brand2",
                "count": 1
              }
            ],
            "filtered": [

            ],
            "viewMode": "picklist"
          },
          {
            "property": "colors",
            "items": [
              {
                "value": "Black",
                "count": 4
              },
              {
                "value": "Silver",
                "count": 3
              },
              {
                "value": "Bronze",
                "count": 1
              },
              {
                "value": "Green",
                "count": 1
              },
              {
                "value": "Mystic Black",
                "count": 1
              },
              {
                "value": "Mystic Pink",
                "count": 1
              },
              {
                "value": "Mystic Silver",
                "count": 1
              },
              {
                "value": "Rose Gold",
                "count": 1
              },
              {
                "value": "White",
                "count": 1
              }
            ],
            "filtered": [

            ],
            "viewMode": "picklist"
          }
        ],
        "meta": {
          "total": 118,
          "page": {
            "current": 1,
            "rows": 60,
            "prev": false,
            "next": true
          },
          "params": {
            "defaultOrder": "BEST_MATCH",
            "currentRow": 60,
            "currency": "€",
            "isCurrencyPlaceBefore": true
          }
        },
        "contents": [

        ],
        "banners": [
          {
            "id": "searchb_f38af653fbd18000",
            "instanceId": "fcs_9d9d5a4bf8000",
            "status": "ACTIVE",
            "searchType": "faceted",
            "name": "Name Of The Banner",
            "bannerUrl": "https://www.example.com/examlpe.png",
            "targetUrl": "https://www.example.com/example_page.html?_sgm_campaign=searchb_f38af653fbd18000&_sgm_source=fcs_9d9d5a4bf8000%7Cbanner&_sgm_action=search&_sgm_term=term",
            "position": "FILTERS_FOOTER",
            "width": "100%",
            "height": "auto",
            "method": "URL",
            "newtab": false
          }
        ],
        "meanings": [

        ],
        "products": [
          {
            "productId": "72155",
            "name": "Product Name",
            "url": "https://www.example.com/product/72155/?_sgm_campaign=fcs_9d9d5a4bf8000&_sgm_source=72155%7Cproduct&_sgm_action=search&_sgm_term=72155",
            "image": "https://www.example.com/72155.png",
            "price": 109.0,
            "priceText": "€109.00",
            "oldPrice": 159.0,
            "oldPriceText": "€159.00",
            "specialPriceText": "",
            "category": [
              "Brands > Product Brand"
            ],
            "lastUpdateTime": 1665477420174,
            "inStock": true,
            "insertTime": 1634135806842,
            "publishTime": 1634135806842,
            "brand": "Product Brand",
            "params": {
              "ws_code": "",
              "variant": "false",
              "addToCartUrl": "https://www.example.com/72155",
              "sku": "PRODUCT_SKU"
            },
            "language": "EN",
            "currency": "EUR",
            "lastBoughtTime": 1660834710537
          }
        ],
        "instanceId": "fcs_9d9d5a4bf8000"
      }
    ]
  ]
}

User/Visitor Operations

Segmentify tracks important user operations like sign-up/register, sign-in/login, sign-out/logout and also you can share your customer's information with Segmentify 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 Segmentify. 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 Segmentify, please use User Update.

Details of parameters of new user is given below:

Name Type Requirement Description Example
User Operation
(step)
String Mandatory Identifies which operation is taken for current user/customer. Each operation has differen meaning and use it accordingly 'signup'
Username
(username)
String Mandatory Unique identifier for the customer 'johndoe'
Full Name
(fullName)
 String Optional Full name of the customer.  'John Doe'
Email
(email)
 String Optional
(Mandatory for using email module)
Email address of the customer  'john.doe@exampleshop.com'
Mobile Phone
(phone)
String Optional Mobile phone number of the customer  '+1 555 555 5555'
Is Login
(isLogin)
Bool Optional Login information of the user true
Is Registered
(isRegistered)
Bool Optional Register information of the customer true
Gender
(gender)
String Optional Gender of the customer. Must be either 'M' or 'F'  'M'
Age
(age)
String Optional Age of the customer. Must be numeric. Either use age or birthdate  27
Birthdate
(birthdate)
String Optional Birthdate of the customer. Must be in format 'DD.MM.YYYY'. Either use age or birthdate  '23.01.1980'
Membership Date
(memberSince)
String Optional Membership date of the customer. Must be in format 'DD.MM.YYYY'  '20.01.2014'
Location
(location)
String Optional Location of the customer  'New York'
Customer Segments
(segments)
Array type String Optional Segments 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 Segmentify.

Details of parameters of user login is given below:

Name Type Requirement Description Example
User Operation
(step)
String Mandatory Identifies which operation is taken for current user/customer 'signin'
Username String Mandatory Unique 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 Segmentify.

Details of parameters of user logout is given below:

Name Type Requirement Description Example
User Operation
(step)
String Mandatory Identifies which operation is taken for current user/customer 'signout'
Username String Mandatory Unique 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 Segmentify, please use New User.

Details of parameters of user update is given below:

Name Type Requirement Description Example
User Operation
(step)
String Mandatory Identifies which operation is taken for current user/customer. Each operation has differen meaning and use it accordingly 'update'
Username
(username)
String Mandatory Unique identifier for the customer 'johndoe'
Full Name
(fullName)
String Optional Full name of the customer.  'John Doe'
Email
(email)
String Optional
(Mandatory for using email module)
Email address of the customer  'john.doe@exampleshop.com'
Mobile Phone
(phone)
 String Optional Mobile phone number of the customer  '+1 555 555 5555'
Gender
(gender)
String Optional Gender of the customer. Must be either 'M' or 'F'  'M'
Age
(age)
String Optional Age of the customer. Must be numeric. Either use age or birthdate  27
Birthdate
(birthdate)
String Optional Birthdate of the customer. Must be in format 'DD.MM.YYYY'. Either use age or birthdate  '23.01.1980'
Membership Date
(memberSince)
String Optional Membership date of the customer. Must be in format 'DD.MM.YYYY'  '20.01.2014'
Location
(location)
String Optional Location of the customer  'New York'
Customer Segments
(segments)
Array type String Optional Segments of the customer. Must be in array format  [ 'SEGMENT 1', 'SEGMENT 2' ]
Is Registered Flag
(isRegistered)
Bool Optional This 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)
Bool Optional This 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 Segmentify and become actionable. With this integration, you can send any non standard events & data to Segmentify, and gives endless opportunities to track and take actions to your visitor's behaviour.

Details of parameters of custom event is given below:

Name Type Requirement Description Example
Type
(type)
String Mandatory Type of the event. You should use same type for same events 'my_custom_event'
Custom Parameters
(params)
Dictionary Optional Custom 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

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

Widget View

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

Name Type Requirement Description Example
instanceId
String Mandatory Identity of the campaign scn_6186a632e0d76001
interactionId
String Mandatory Identity of the action act_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.

Name Type Requirement Description Example
instanceId
String Mandatory Identity of the campaign instanceId = "scn_6186a632e0d76001"
interactionId
String Mandatory Unique id of the product interactionId = "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.

Name Type Requirement Description Example
instanceId
String Mandatory Identity of the product for before search input instanceId = "bs_product"
interactionId
String Mandatory Unique id of the product for before search input interactionId = "123456789"

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

Name Type Requirement Description Example
instanceId
String Mandatory Identity of the product for after search input instanceId = "product"
interactionId
String Mandatory Unique id of the product for after search input interactionId = "123456789"
SegmentifyManager.INSTANCE.sendSearchClickView("product","123456789");

Searchandising Click

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

Name Type Requirement Description Example
instanceId
String Mandatory Identity of the campaign instanceId = "fcs_aa01825dcc000"
interactionId
String Mandatory Unique id of the campaign interactionId = "123456789|product"
SegmentifyManager.INSTANCE.sendSearchClickView("product","123456789|product");

Banners

Event Types and Definitions

Event Description Event Name
Banner Operations Events 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 View Event that needs to be sent for the banner group uploaded to the page. BANNER_GROUP_VIEW
Internal Banner Group The event that feeds the active banner status in the relevant group and the information of these banners to the Segmentify. INTERNAL_BANNER_GROUP

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

Name Type Requirement Description Example
Type
(type)
String Mandatory Banner operation type. Can be 'impression', 'click' or 'update' 'impression'
Title
(title)
String Mandatory Title of the banner 'Home Page Banner'
Group
(group)
String Mandatory Group of the banner 'Home Page Banner - Group 1'
Order
(url)
NSNumber  Mandatory Order of the banner in the group 1
Product ID
(productId)
String  Optional Unique id of the product 'EXAMPLE_PRODUCT_1'
Category
(category)
String Optional Hierarchical category of the product 'Men > Sports > Shoes'
Brand
(brand)
String Optional Brand of the product 'EXAMPLE BRAND'
Label
(label)
String Optional Custom 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):

Name Type Requirement Description Example
Group
(group)
String Mandatory Group 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):

Name Type Requirement Description Example
Group
(group)
String Mandatory Group of the banner 'Home Page Banner - Group 1'
Banners
(banners)
Array type Any Optional List of banners. Must be in array format. Details are given at banner details [banner1,banner2]
Name Type Requirement Description Example
Title
(title)
String Optional Title of the banner 'Home Page Banner'
Image
(image)
String Optional Image of the banner 'https://example.com/image.jpg'
Order
(url)
NSNumber  Optional Order of the banner 1
Urls
(urls)
Array type Any Optional Urls 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);