{"_id":"56a1831f44f3d80d00a2c3c9","parentDoc":null,"project":"5668fab608f90021008e882f","githubsync":"","user":"56839cf74aecbd0d00a4659e","version":{"_id":"5668fab608f90021008e8832","__v":19,"project":"5668fab608f90021008e882f","createdAt":"2015-12-10T04:08:22.769Z","releaseDate":"2015-12-10T04:08:22.769Z","categories":["5668fab708f90021008e8833","569740f124490c3700170a64","569742b58560a60d00e2c25d","569742bd0b09a41900b2446c","569742cd69393517000c82b3","569742f459a6692d003fad8f","569743020b09a41900b2446d","5697430b69393517000c82b5","56a17776470ae00d00c30642","56a2c48a831e2a0d0069b1ad","56b535757bccae0d00e9a1cd","56e1ff6aa49fdc0e005746b5","57e1c88115bf6522002a5e4e","57fa65275ba65a17008b988f","57fbeea34002550e004c032e","58474584889b6c2d00fb86e9","58475dcc64157f0f002f1907","587e7b5158666c2700965d4e","58a349fc30852819007ba083"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.18.0","version":"1.18"},"__v":10,"category":{"_id":"56a17776470ae00d00c30642","version":"5668fab608f90021008e8832","__v":5,"project":"5668fab608f90021008e882f","pages":["56a1827ad847b50d00a27729","56a1831f44f3d80d00a2c3c9","56a18a6244f3d80d00a2c3d3","56a18a83932d7c0d008bf231","56a18d1bd847b50d00a27735"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-22T00:27:34.102Z","from_sync":false,"order":5,"slug":"inventory","title":"Inventory (JavaScript)"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-22T01:17:19.495Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Concept of inventory item and field\",\n  \"body\": \"We’ll use the term `inventory item` for an item that we could potentially show in recommendations. For instance:<ul>\\n<li>On a typical news or viral content website, the `inventory items` are articles.</li>\\n<li>On a video website, the `inventory items` are videos.</li>\\n<li>On a retail website, the `inventory items` are the products being sold.</li>\\n</ul>\\nWe’ll use the term field for each piece of information about a given item. For instance, the typical fields for an article `inventory item` include title, URL, image, and description.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How our scraping works\"\n}\n[/block]\nPrior to sending you our Javascript snippet, we identify what `inventory item` means in the context of your website, and set up our scraping to collect inventory information only for those items. We generally set up preliminary filters based on the pattern of the URL, and the type of the page as specified in the page metadata.\n\nOnce you install our Javascript, we start scraping your inventory. Every time a user visits a page on your website that meets our critera for an inventory item, we collect all the fields from that page and send it to our servers. If the item is not currently in our inventory, we add it. Otherwise we update it.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Almost-real-time inventory\"\n}\n[/block]\nOur inventory is up-to-date subject to the following caveats:\n<ul>\n<li>We can only detect pages that have been visited at least once by a user while our Javascript was installed.</li>\n<li>We update fields for a page only when it is visited, and it gets deleted if nobody has accessed it for more than 30 days (we can remove the TTL depending on your use case).</li>\n<li>If a page gets deleted, and didn't clean up the data by using the inventory DELETE endpoint of our REST API. You can configure the TTL for items inserted through REST API [here](https://liftigniter.readme.io/docs/inventory). </li>\n</ul>\nThis almost-real-time inventory is sufficient for most of our customers. If you have more advanced needs (for instance, more rapidly changing content, or a huge amount of older content that gets a very small number of views) you may want to use our [inventory API instead](https://liftigniter.readme.io/docs/api-overview).","excerpt":"","slug":"what-is-inventory","type":"basic","title":"What is Inventory?"}

What is Inventory?


[block:callout] { "type": "info", "title": "Concept of inventory item and field", "body": "We’ll use the term `inventory item` for an item that we could potentially show in recommendations. For instance:<ul>\n<li>On a typical news or viral content website, the `inventory items` are articles.</li>\n<li>On a video website, the `inventory items` are videos.</li>\n<li>On a retail website, the `inventory items` are the products being sold.</li>\n</ul>\nWe’ll use the term field for each piece of information about a given item. For instance, the typical fields for an article `inventory item` include title, URL, image, and description." } [/block] [block:api-header] { "type": "basic", "title": "How our scraping works" } [/block] Prior to sending you our Javascript snippet, we identify what `inventory item` means in the context of your website, and set up our scraping to collect inventory information only for those items. We generally set up preliminary filters based on the pattern of the URL, and the type of the page as specified in the page metadata. Once you install our Javascript, we start scraping your inventory. Every time a user visits a page on your website that meets our critera for an inventory item, we collect all the fields from that page and send it to our servers. If the item is not currently in our inventory, we add it. Otherwise we update it. [block:api-header] { "type": "basic", "title": "Almost-real-time inventory" } [/block] Our inventory is up-to-date subject to the following caveats: <ul> <li>We can only detect pages that have been visited at least once by a user while our Javascript was installed.</li> <li>We update fields for a page only when it is visited, and it gets deleted if nobody has accessed it for more than 30 days (we can remove the TTL depending on your use case).</li> <li>If a page gets deleted, and didn't clean up the data by using the inventory DELETE endpoint of our REST API. You can configure the TTL for items inserted through REST API [here](https://liftigniter.readme.io/docs/inventory). </li> </ul> This almost-real-time inventory is sufficient for most of our customers. If you have more advanced needs (for instance, more rapidly changing content, or a huge amount of older content that gets a very small number of views) you may want to use our [inventory API instead](https://liftigniter.readme.io/docs/api-overview).