Smart Recommender

Prev Next
Your title goes here
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 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.

Your title goes here
You can examine each method to find the method suitable for 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. 

Your title goes here

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

getSmartRecommendation(recommendationID: number, locale: string, currency: string): Promise <any>;

Method Example

const smartData = await window.Insider.getSmartRecommendation(1, 'en_US', 'USD');

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. 

Your title goes here

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

getSmartRecommendationWithProduct(product: object, recommendationID: number, locale: string): Promise <any>;

Method Example

var product = await window.Insider.createNewProduct('product_id',
        'Apple',
        taxonomy,
        'imageURL',
        1000.5,
        'currency');
const smartDataWithProduct = await window.Insider.getSmartRecommendationWithProduct(product, 1, 'en_US');

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. 

Your title goes here
The available algorithms are as follows:
o Purchased Together
o Viewed Together
Your title goes here
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 that you see against the Smart Recommender campaigns on your Inone panel.

Method Signature

static getSmartRecommendationWithProductIDs(productIDs: array, recommendationID: number, locale: string, currency: string, callback: Function)

Method Example

window.Insider.getSmartRecommendationWithProductIDs(["XX", "YY", "ZZ"], 1, "en_US", "US", (recommendation) => {
      console.log("getSmartRecommendation:", recommendation);
});

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 have the statistics for users, impressions, clicks, add-to-carts, purchases, and revenue that are calculated by Insider SDK based on image clicks.

Your title goes here
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 to have the correct product IDs in the Insider product object you use for Click, Add to Cart, and Revenue.

Click (clickSmartRecommendationWithProductID)

When a user clicks on the recommendation slider and visits the product, you should trigger the method to log this click.

Your title goes here
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 that you see against the Smart Recommender campaigns on your Inone panel.

Method Signature

clickSmartRecommendationProduct(product: object, recommendationID: number): void;

Method Example

var product = await window.Insider.createNewProduct('product_id',
        'Apple',
        taxonomy,
        'imageURL',
        1000.5,
        'currency');

window.Insider.clickSmartRecommendationProduct(product,1);

Add-to-carts

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

Your title goes here
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 is the same as the revenue tracking method. Refer to Track Revenue for the method signatures.

Your title goes here
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.

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