Visit events
To measure the available inventory for ads, it is necessary to send the contextual information related to each placement defined during the setup of your account. In a client-side integration, triggering this event will display the ads.
The table below lists the different possible page types along with their corresponding codes :
| Placement | Code |
|---|---|
| Homepage | home |
| Hub navigation page | hub |
| Search result page | search |
| Product listing page | plp |
| Product detail page | pdp |
Homepage
Section titled “Homepage”The following event should be fired for the home placement:
Example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "home", alias: "233eca12ac66bd99b410dae07ca910d9" } });</script>Search result page
Section titled “Search result page”The following event should be fired for the search placement:
Minimal example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "search", search_terms: "smart home device" } });</script>Full example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "search", search_terms: "smart home device", alias: "233eca12ac66bd99b410dae07ca910d9", listed_products: { ids: ["skuPos1", "skuPos2", "skuPos3", "skuPos4"], total: 2872, page: 1, sort: "popularity", filters: [ {code: "color", op: "in", value: ["red", "blue"]}, {code: "seller", op: "eq", value: "ACME NG"}, {code: "price", op: "lte", value: 299.99}, {code: "rating", op: "gt", value: 3.5} ] } } });</script>Product listing page
Section titled “Product listing page”The following event should be fired for the plp placement:
Minimal example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "plp", category: "c29023" } });</script>// Some codeFull example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "plp", category: "c29023", alias: "233eca12ac66bd99b410dae07ca910d9", listed_products: { ids: ["skuPos1", "skuPos2"], total: 287, page: 2, sort: "price_asc", filters: [ {code: "color", op: "eq", value: "white"}, {code: "free_delivery", op: "eq", value: true}, {code: "price", op: "lt", value: 99.99}, {code: "rating", op: "gte", value: 4} ] } } });</script>Product detail page
Section titled “Product detail page”The following event should be fired for the pdp placement:
Minimal example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "pdp", product: { id: "sku910d", categories: ["c290", "c2902", "c29023"] } } });</script>Full example
<script type="text/javascript"> window.vzbl_q = window.vzbl_q || []; window.vzbl_q.push({ event: "visit", value: { placement: "pdp", alias: "233eca12ac66bd99b410dae07ca910d9", product: { id: "sku910d", categories: ["c290", "c2902", "c29023"], price: 456.90, availability: "in stock", rating: 4.2, reviews: 168 } } });</script>| Parameters | Description | Mandatory |
|---|---|---|
| placement | The code of the type of page visited / location Example: "home", "search", "plp", "pdp" | YES |
| search_terms | The keywords searched by the user Example: "my search terms" | YES (search) |
| category | The main category id of the product listing page Example: "cat1302" | YES (plp) |
| product.id | The product identifier of the product detail page Example: "pid9123374" | YES (pdp) |
| product.categories | Identifiers of product categories Example: ["cat1", "cat13", "cat1302"] | YES (pdp) |
| listed_products.ids | A table containing the identifiers of the products present on the current page Example: ["pid1", "pid23", "pid372"] | NO (search, plp) |
| alias | The customer identifier transformed with a hash function (MD5, SHA-256) | NO |