Suggested readings: Page object, User object, Listing object, Basket object, Transaction object
The Product Object includes the product properties. If the product properties are changeable without reloading the page, this object must be updated, too. The product object must be implemented on the pages where a single product is displayed.
This guide answers the following questions:
- What are the prerequisites?
- What are the properties?
- What are the things to keep in mind?
- How can I monitor if the integration works correctly?
What are the prerequisites?
- Insider tag must be implemented.
- 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 Product object has the following properties.
| Key | Property | Type | Definition | Character Limit | Required |
|---|---|---|---|---|---|
| id | Product ID | String | Unique product ID | 128 | Yes |
| name | Product Name | String | Name of the product | 512 | Yes |
| locale | Locale | String | Unique locale identifier | 64 | Yes |
| taxonomy | Breadcrumb | Array | Category tree of the product | 1024 | Yes |
| group_code | Groupcode | String | Used to group product variants | 512 | No |
| currency | Currency | String | Currency used for product pricing, in ISO 4217 format (e.g. USD) | N/A | Yes |
| unit_price | Product price without any discount(s) | Float | Price of the product without any discount(s) | N/A | Yes |
| unit_sale_price | Unit price | Float | Unit price of the product | N/A | Yes |
| omnibus_price | Omnibus price | Number | Omnibus price of the product | N/A | No |
| omnibus_discount | Omnibus discount | Number | Omnibus discount of the product | N/A | No |
| discount | Discount information | Object | Auto-calculated from price and original price as a percentage | N/A | No |
| sku | Stock Keeping Unit information | String | Stock-keeping unit | 512 | No |
| url | Product page link | String | URL address of the product | 512 | Yes |
| in_stock | Stock information | Number | Binary stock availability | “0” or “1” | Yes |
| stock | Stock information | Number | Number of products left in stock | N/A | No |
| color | Product color | String | Color of the product (selected by user) | 512 | No |
| brand | Brand | String | Product brand | 512 | No |
| rating | Rating | Number | Product rating | Min 1 , Max 10 | No |
| size | Product size | String | Size of the product (selected by user) | 512 | No |
| gender | Gender | String | Gender information of the product | 512 | No |
| product_type | Product type | String | Specifies the product type information | 512 | No |
| product_image_url | Product image link | String | URL address of the product image | 512 | Yes |
| item_update_date | Item update date | String | It takes date time (YYYY-MM-DD HH:MM:SS). It’s used by publisher customers for filtering the last 2 days of content. | 512 | Yes → Only for published-time based |
| item_start_date | Item start date | String | It takes date time (YYYY-MM-DD HH:MM:SS). It’s used for event websites for getting the event start dates. | 512 | Yes -> Only for published-time based |
| item_end_date | Item end date | String | It takes date time (YYYY-MM-DD HH:MM:SS). It’s used for event websites to get event end dates. | 512 | Yes -> Only for published-time based |
| description | Description | String | Description of the product | 1024 | No |
| gtin | Global Trade Item Number | String | Global Trade Item Number | 512 | No |
| multipack | Multipack information | String | Specifies a multipack item | 512 | No |
| tags | Product tags | Array[String] | List of tags of the product in a List of String model. When the total list is converted to a string, the string character size should be at most 4096. | 4096 | No |
| category_path | Category path | String | String version of the category | 1024 | No |
| custom | Custom | Object | Custom object that includes custom properties to be collected to Insider database as custom event parameters | No |
What are the things to keep in mind?
When integrating the object, the following factors should be considered.
- window.insider_object.product object should return on the page.
- After running window.insider_object.page.type on the browser console, the page object should return the type as Product.
- window.insider_object.product.taxonomy should return the correct breadcrumb hierarchy.
- The object should update the product information when the product changes.
Sample code
Below is a sample code for the Product object.
window.insider_object = window.insider_object || {};
window.insider_object.product = {
"id": "abc1234",
"name": "Blue Dress",
"taxonomy": [
"Dresses",
"Night Dresses",
"Long Sleeve"
],
"currency": "USD",
"unit_price": 100.00,
"unit_sale_price": 95.00,
"discount": 15,
"omnibus_price": 90.00,
"omnibus_discount": 15,
"currency": "USD",
"locale": "en_US",
"groupcode": "7226463649905",
"url": "http://www.mywebsite.com/en-US/product/abc1234/",
"in_stock": 1,
"stock": 11,
"color": "Blue",
"brand": "Posh Street",
"gender": "Female",
"size": "S",
"product_image_url": "http://www.mywebsite.com/product_images/abc1234.png",
"custom": {
"merchandiser": "store123"
}
}In addition to the properties defined in the table above, you can add custom properties to any object. Such properties should be added under the custom object, as in the example above.
How can I 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 afterwards. If you have already implemented the integration, you can use the wizard only to test it as well.
