Documentation Index

Fetch the complete documentation index at: https://academy.insiderone.com/llms.txt

Use this file to discover all available pages before exploring further.

Smart Recommender

Prev Next
Before starting to use this method, make sure to complete the following:
- The locale attribute of the user object
- The product object along with the stock attribute

You can get recommendation data in the SDK via three different methods:

  • Get Smart Recommendation (getSmartRecommendationWithID)
  • Get Smart Recommendation with Product (getSmartRecommendationWithProduct)
  • Get Recommendation with Product IDs (getSmartRecommendationWithProductIDs)

You can use these methods with different use cases and recommendation strategies together.

You can examine each method to find the one that best suits your recommendation strategy for the campaign you created on Inone. For example, if your recommendation strategy on Inone is Top Sellers, you should use the getSmartRecommendationWithID method as the respective method suggests.

Get Smart Recommendation (getSmartRecommendationWithID)

This method allows you to get recommendations that are not based on product details. You should call this method with the related campaign ID, and select the correct algorithms for the campaign IDs on the panel. 

Below you can see the parameters of the method:

ParameterData Type
recommendationIDInteger
localeString
currencyString
recommendationDictionary

The recommendationID is the ID that you see against the Smart Recommender campaigns on your Inone panel.

Method Signature

public void getSmartRecommendation(int recommendationID, String locale, String currency, RecommendationEngine.SmartRecommendation smartRecommendation)
fun getSmartRecommendation(
     recommendationID: Int,
     locale: String,
     currency: String,
     smartRecommendation: RecommendationEngine.SmartRecommendation
 )

Method Example

Insider.Instance.getSmartRecommendation(1, "en_EN", "currency", new RecommendationEngine.SmartRecommendation() {
@Override
        public void loadRecommendationData(JSONObject recommendation) {
        // Handle here
        }
});
Insider.Instance.getSmartRecommendation(1, "en_US", "USD") { recommendation ->
     // Handle the response here
 }

Get Smart Recommendation with Product (getSmartRecommendationWithProduct)

This method allows you to get recommendations that are based on product details. You should call this method with the related campaign ID and select the correct algorithms for the campaign IDs on the panel. 

Below you can see the parameters of the method:

ParameterData Type
recommendationIDInteger
localeString
productInsider product object
recommendationDictionary

The recommendationID is the ID that you see against the Smart Recommender campaigns on your Inone panel.

Method Signature

public void getSmartRecommendationWithProduct(InsiderProduct product, int recommendationID, String locale, RecommendationEngine.SmartRecommendation smartRecommendation)
fun getSmartRecommendationWithProduct(
     product: InsiderProduct,
     recommendationID: Int,
     locale: String,
     smartRecommendation: RecommendationEngine.SmartRecommendation
 )

Method Example

Insider.Instance.getSmartRecommendationWithProduct(insiderExampleProduct, 1, "en_EN", new RecommendationEngine.SmartRecommendation(){
    @Override
        public void loadRecommendationData(JSONObject recommendation) {
    }
});
Insider.Instance.getSmartRecommendationWithProduct(insiderExampleProduct, 1, "en_US") { recommendation ->
     // Handle the response here
 }

Get Recommendation with Product IDs (getSmartRecommendationWithProductIDs)

This method allows you to get recommendations that are based on product details. You should call this method with the related campaign ID and select the correct algorithms for the campaign IDs on the panel. 

The available algorithms are as follows:
o Purchased Together
o Viewed Together
o Manual Merchandising
Mixed Strategy
The maximum number of product IDs you can use for this method is 3. For product IDs sent more than 3 with Array, it will work for the first 3 product IDs only.
ParameterData Type
recommendationIDInteger
localeString
productIDsArray
recommendationDictionary
currencyString

The recommendationID is the ID you see next to the Smart Recommender campaigns on your InOne panel.

Method Signature

public void getSmartRecommendationWithProductIDs(String [] productIDs, int recommendationID, String locale, String currency, RecommendationEngine.SmartRecommendation smartRecommendation)
fun getSmartRecommendationWithProductIDs(
     productIDs: Array<String>,
     recommendationID: Int,
     locale: String,
     currency: String,
     smartRecommendation: RecommendationEngine.SmartRecommendation
 )

Method Example

String[] productIDs = {"XXX", "YYY", "ZZZ"};
 
Insider.Instance.getSmartRecommendationWithProductIDs(productIDs, 3, "en_US", “USD”, new RecommendationEngine.SmartRecommendation() {
    @Override
    public void loadRecommendationData(JSONObject recommendation) {
       // Handle Here
    }
});
val productIDs = arrayOf("XXX", "YYY", "ZZZ")

 Insider.Instance.getSmartRecommendationWithProductIDs(productIDs, 3, "en_US", "USD") { recommendation ->
     // Handle the response here
 }

Logger for Statistics

You can track the impressions, users, and clicks of your recommendations once Insider SDK starts logging the required data. Using statistics, you can measure your return on investment.

You need to integrate the functionality of the statistics regarding your design. Insider offers Clicks, and it is calculated based on clicks only. In your reports, you will find statistics for users, impressions, clicks, add-to-carts, purchases, and revenue, calculated by the Insider SDK based on image clicks.

If you want to obtain statistics for your smart recommender campaigns, you should integrate the following methods for clicks, revenue, and add-to-cart.

All mapping is done by product ID. Make sure the correct product IDs are in the Insider product object you use for Click, Add to Cart, and Revenue.

Click (clickSmartRecommendationWithProductID)

When a user clicks the recommendation slider and visits the product, you should trigger the method that logs this click.

This method is crucial for Add to Cart and Revenue statistics. If you do not trigger this method before the Add to Cart and Revenue tracking methods, your Add to Cart and Revenue statistics will not be reflected on the panel.
 
When you use the Click method once for the product clicked in a session (between app opening and closing), the Add to Cart and Revenue methods for the same product in the same session will be valid.

When a different product is clicked, you need to trigger the Click method for the respective clicked product again.

If your app allows adding smart recommender products to the cart without visiting them, you should trigger this event before triggering the Add to Cart method.

Below you can see the parameters of the method:

ParameterData Type
recommendationIDInteger
productInsider product object

The recommendationID is the ID you see next to the Smart Recommender campaigns on your Inone panel.

Method Signature

public void clickSmartRecommendationProduct(int recommendationID, InsiderProduct product)
fun clickSmartRecommendationProduct(recommendationID: Int, product: InsiderProduct)

Method Example

Insider.Instance.clickSmartRecommendationProduct(1, insiderExampleProduct);

Add to Cart

This method is the same as item added to cart. Refer to Item Added to Cart for the method signatures.

The product ID of the product object you use in the Item Added to Cart method must be the same as the product ID you specify when it is clicked.

Revenue

This method requires the Insider's Confirmation Page View (Purchase) method with the Product object to be triggered.

The product ID of the product object you use in the Confirmation Page View (Purchase) method must be the same as the product ID you specify when it is clicked.
The goal conversion is session-based and not customizable. If the clicks are tracked on the analytics, it means it is a click-through-based. Revenue is product-based, not transaction-based, unless the customer requests a custom integration.

Sample Responses

The following response example illustrates the Smart Recommender output with the details parameter set to true.

{
    "success": true,
    "total": 25,
    "types": {
        "mpop": 25
    },
    "data": [
        {
            "image_url": "https://example.com/image1.jpg",
            "name": "iPhone 16 Pro 256GB",
            "item_id": "1361384",
            "url": "https://example.com/product/1361384",
            "description": "First Apple AI-powered smartphone with advanced text and image generation.",
            "in_stock": 1,
            "price": {
                "USD": 1250
            },
            "product_type": "Electronics > Smartphones > Apple",
            "brand": "APPLE",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 1250
            }
        },
        {
            "image_url": "https://example.com/image2.jpg",
            "name": "AirPods 4 Bluetooth Earphones",
            "item_id": "1367206",
            "url": "https://example.com/product/1367206",
            "description": "Active noise cancellation, Bluetooth 5.3, USB-C charging, and sweat resistance.",
            "in_stock": 1,
            "price": {
                "USD": 199
            },
            "product_type": "Accessories > Audio > Apple",
            "brand": "APPLE",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 199
            }
        },
        {
            "image_url": "https://example.com/image3.jpg",
            "name": "Nintendo Sound Clock Alarmo",
            "item_id": "1364283",
            "url": "https://example.com/product/1364283",
            "description": "Interactive alarm clock with special Nintendo sounds.",
            "in_stock": 1,
            "price": {
                "USD": 119
            },
            "product_type": "Gaming > Accessories > Nintendo",
            "brand": "NINTENDO",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 119
            }
        },
        {
            "image_url": "https://example.com/image4.jpg",
            "name": "iPhone 16 256GB",
            "item_id": "1361368",
            "url": "https://example.com/product/1361368",
            "description": "A18 chip, AI-powered features, and advanced photography capabilities.",
            "in_stock": 1,
            "price": {
                "USD": 1050
            },
            "product_type": "Electronics > Smartphones > Apple",
            "brand": "APPLE",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 1050
            }
        },
        {
            "image_url": "https://example.com/image5.jpg",
            "name": "PS5 Dynasty Warriors Origin",
            "item_id": "1370198",
            "url": "https://example.com/product/1370198",
            "description": "New action-packed strategy game for PlayStation 5.",
            "in_stock": 1,
            "price": {
                "USD": 59
            },
            "product_type": "Gaming > PS5 > Action",
            "brand": "SONY",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 59
            }
        },
        {
            "image_url": "https://example.com/image6.jpg",
            "name": "Apple Watch Series 9",
            "item_id": "1398765",
            "url": "https://example.com/product/1398765",
            "description": "Advanced health tracking and always-on display.",
            "in_stock": 1,
            "price": {
                "USD": 399
            },
            "product_type": "Wearables > Smartwatches > Apple",
            "brand": "APPLE",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 399
            }
        },
        {
            "image_url": "https://example.com/image7.jpg",
            "name": "Samsung Galaxy S24 Ultra",
            "item_id": "1341488",
            "url": "https://example.com/product/1341488",
            "description": "6.8-inch screen, 200MP camera, and high-performance processor.",
            "in_stock": 1,
            "price": {
                "USD": 1299
            },
            "product_type": "Electronics > Smartphones > Samsung",
            "brand": "SAMSUNG",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 1299
            }
        },
        {
            "image_url": "https://example.com/image8.jpg",
            "name": "Sony WH-1000XM5 Wireless Headphones",
            "item_id": "1325678",
            "url": "https://example.com/product/1325678",
            "description": "Industry-leading noise cancellation with up to 30-hour battery life.",
            "in_stock": 1,
            "price": {
                "USD": 349
            },
            "product_type": "Audio > Headphones > Sony",
            "brand": "SONY",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 349
            }
        },
        {
            "image_url": "https://example.com/image9.jpg",
            "name": "MacBook Pro M3 16-inch",
            "item_id": "1423456",
            "url": "https://example.com/product/1423456",
            "description": "M3 chip, 16-inch Retina display, and all-day battery life.",
            "in_stock": 1,
            "price": {
                "USD": 2399
            },
            "product_type": "Electronics > Laptops > Apple",
            "brand": "APPLE",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 2399
            }
        },
        {
            "image_url": "https://example.com/image10.jpg",
            "name": "iPad Pro 12.9-inch M2",
            "item_id": "1445678",
            "url": "https://example.com/product/1445678",
            "description": "M2 chip, Liquid Retina XDR display, and Apple Pencil support.",
            "in_stock": 1,
            "price": {
                "USD": 1099
            },
            "product_type": "Electronics > Tablets > Apple",
            "brand": "APPLE",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 1099
            }
        },
        {
            "image_url": "https://example.com/image11.jpg",
            "name": "Xbox Series X",
            "item_id": "1456789",
            "url": "https://example.com/product/1456789",
            "description": "The most powerful Xbox ever with 4K gaming and 120fps support.",
            "in_stock": 1,
            "price": {
                "USD": 499
            },
            "product_type": "Gaming > Consoles > Xbox",
            "brand": "MICROSOFT",
            "locale": "en_us",
            "discount": {
                "USD": 0
            },
            "original_price": {
                "USD": 499
            }
        }
    ]
}

This response example demonstrates the Smart Recommender output with the details parameter set to false.

{
  "success": true,
  "total": 25,
  "types": {
    "mpop": 25
  },
  "data": [
    "1111111",
    "1111112",
    "1111113",
    "1111114",
    "1111115",
    "1111116",
    "1111117",
    "1111118",
    "1111119",
    "1111120",
    "1111121",
    "1111122",
    "1111123",
    "1111124",
    "1111125",
    "1111126",
    "1111127",
    "1111128",
    "1111129",
    "1111130",
    "1111131",
    "1111132",
    "1111133",
    "1111134",
    "1111135"
  ]
}

For troubleshooting, refer to Why do different recommendation algorithms display the same products, Why do we see an issue with Smart Recommender logs, How can we track Smart Recommender campaign performance, What algorithms and campaign management options are available, Why is product ID consistency important