Suggested readings: Page object, User object, Product object, Basket object, Transaction object
Sending product information in the Items array is entirely optional. If you want to send this information, share your use case with the Insider One team.
The Listing Object includes information about a category or a search result page. The page where this object is implemented should have multiple products, excluding the recommendations. If the products are changeable without any page reload, this object must also be updated.
This guide answers the following questions:
- What are the prerequisites?
- What are the properties?
- What are the things to keep in mind?
- How can we monitor if the integration works correctly?
What are the prerequisites?
- The Insider tag must be implemented.
- The Insider Object must be defined before the Insider tag. Otherwise, the Insider tag cannot read any information from the Insider Object.
What are the properties?
The Listing object has the following properties.
| Key | Property | Type | Definition | Required |
|---|---|---|---|---|
| items | Product list | Array | Array of objects | No |
| id | Product ID | String | Unique product ID | Yes |
| name | Product Name | String | Name of the product | Yes |
| taxonomy | Breadcrumb | Array | Category tree of the product | Yes |
| currency | Currency | String | Currency used for product pricing, in ISO 4217 format (e.g., USD) | Yes |
| unit_price | Product price without any discount(s) | Float | Price of the product without any discount(s) | Yes |
| unit_sale_price | Unit price | Float | Unit price of the product | Yes |
| url | Product page link | String | URL address of the product | Yes |
| stock | Stock information of the product | Number | Number of products left in stock | No |
| color | Product color | String | Color of the product | No |
| size | Product size | String | Size of the product | No |
| product_image_url | Product image link | String | URL address of the product image | Yes |
| custom | Custom | Object | Custom object that includes custom properties to be collected to the Insider database as custom event parameters | No |
What are the things to keep in mind?
When integrating the object, the following factors should be taken into consideration.
- The page should return Category for the type after running window.insider_object.page.type in the browser console.
- window.insider_object.listing should show an object list of all the products on the page.
- window.insider_object.listing object should update when products on the page are changed.
Sample code
Below is a sample code for the Listing object.
window.insider_object = window.insider_object || {};
window.insider_object.listing = {
"items": [
{
"id": "abc1234",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"currency": "USD",
"unit_price": 100.00,
"unit_sale_price": 95.20,
"url": "http://www.mywebsite.com/en-US/product/abc1234/",
"stock": 11,
"color": "Blue",
"size": "S",
"product_image_url": "http://www.mywebsite.com/product_images/abc1234.png",
"custom": {
"merchandiser": "store123"
}
},
{
"id": "def1234",
"name": "Red Shoes",
"taxonomy": [
"Shoes",
"Heels",
"Platform"
],
"currency": "USD",
"unit_price": 100.00,
"unit_sale_price": 95.20,
"url": "http://www.mywebsite.com/en-US/product/def1234/",
"stock": 11,
"color": "Red",
"size": "38",
"product_image_url": "http://www.mywebsite.com/product_images/def1234.png"
}
]
}How can we monitor if the integration works correctly?
Once you deploy your integration, you can test it via the Website Integration Wizard. This wizard helps you complete your integration and test it afterward. If you have already implemented the integration, you can use the wizard only to test it.