Listing Object
  • 28 Dec 2023
  • 2 Minutes to read

    Listing Object


      Article Summary

      Listing Object includes the information about a category or a search result page. There should be multiple products on the page where this object is implemented, excluding the recommendations. If the products are changeable without any page reload, this object must be updated too.

      What are the prerequisites?

      • Insider tag must be implemented.
      • Insider object must be defined before the Insider tag. Otherwise Insider tag cannot read any information from the Insider object

      What are the properties?

      The Listing object has the following properties.

      KeyPropertyTypeDefinitionRequired
      itemsProduct listArrayArray of objectsYes
      idProduct IDStringUnique product IDYes
      nameProduct NameStringName of the productYes
      taxonomyBreadcrumbArrayCategory tree of the productYes
      currencyCurrencyStringCurrency used for product pricing, in ISO 4217 format (e.g. USD)Yes
      unit_priceProduct price without any discount(s)FloatPrice of the product without any discount(s)Yes
      unit_sale_priceUnit priceFloatUnit price of the productYes
      urlProduct page linkStringURL address of the productYes
      stockStock information of the productNumberNumber of products left in stockNo
      colorProduct colorStringColor of the productNo
      sizeProduct sizeStringSize of the productNo
      product_image_urlProduct image linkStringURL address of the product imageYes
      customCustomObjectCustom object that includes custom properties to be collected to Insider database as custom event parametersNo

      What are the things to keep in mind?

      When integrating the object, the following factors should be considered.

      • The page should return Category for the type after running window.insider_object.page.type on 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 I monitor if it works correctly?

      Once you deploy your integration, you can test it via different methods.

      Insider Object 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. See more on the Insider Object Integration Wizard.

      Browser Test

      You can visit your website and navigate to a category/listing page to test the Listing object.

      1. Right click on your website to inspect the page.
      2. Go to Developer Console.
      3. Run insider_object or insider_object.listing to see your object.
      4. Make sure that it follows the criteria stated in the properties.

      Was this article helpful?

      What's Next
      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses