API Integration
Event-specific attributes
Check out our Events overview page to understand the functioning of each event.
Visitor
Template API:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | visitor |
url | string | Website URL where the search is performed |
visit_type | string | Either first_time or repeat |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Search Hit
Template API:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | search |
query | string | The search query entered by the shopper |
url | string | Website URL where the search is performed |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Search Impression
Template API:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | PRODUCT_IMPRESSIONS |
pid | string | Unique ID for the product, to be taken from the search API response |
variantId (optional) | string | Variant ID assigned to the variant of the product. Necessary only if variants are present. |
url | string | Website URL where the search is performed |
visit_type | string | Either first_time or repeat |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Browse Impression
Template API:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | PRODUCT_IMPRESSIONS |
pid | string | Unique ID for the product, to be taken from the search API response |
qty | string | The number of units added to the cart (as a string). For example, “2” for 2 units. |
variantId (optional) | string | Variant ID assigned to the variant of the product. Necessary only if variants are present. |
url | string | Website URL where the search is performed |
visit_type | string | Either first_time or repeat |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Product Click
Template API:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | click |
pid | string | Unique ID for the product, to be taken from the search API response |
url | string | Website URL where the search is performed |
visit_type | string | Either first_time or repeat |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Search Facets
Template API: Selection and Deselection of facets
Template API: Clear All facets
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | facets |
pid | string | Unique ID for the product, to be taken from the search API response |
qty | string | The number of units added to the cart (as a string). For example, “2” for 2 units. |
variantId (optional) | string | Variant ID assigned to the variant of the product. Necessary only if variants are present. |
url | string | Website URL where the search is performed |
visit_type | string | Either first_time or repeat |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Browse Facets
Template API: Selection and Deselection of facets
Template API: Clear All facets
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | facets |
pid | string | Unique ID for the product, to be taken from the search API response |
qty | string | The number of units added to the cart (as a string). For example, “2” for 2 units. |
variantId (optional) | string | Variant ID assigned to the variant of the product. Necessary only if variants are present. |
url | string | Website URL where the search is performed |
visit_type | string | Either first_time or repeat |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Add to Cart
Template API:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | cart |
pid | string | Unique ID for the product, to be taken from the search API response |
qty | string | The number of units added to the cart (as a string). For example, "2" for 2 units. |
variantId (optional) | string | Variant ID assigned to the variant of the product. Necessary only if variants are present. |
url | string | Website URL where the search is performed |
visit_type | string | Either "first_time" or "repeat" |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |
Order
Template API for single product:
Template API for multiple product:
Refer here for our sample API
Payload details:
Attribute Name | Type | Value to Pass |
---|---|---|
action | string | order |
pid | string | Unique ID for the product, to be taken from the search API response |
qty | string | The number of units added to the cart (as a string). For example, "2" for 2 units. |
variantId (optional) | string | Variant ID assigned to the variant of the product. Necessary only if variants are present. |
price | string | Unit price of the product and its variant (if variant is selected). |
url | string | Website URL where the search is performed |
visit_type | string | Either "first_time" or "repeat" |
UnbxdKey | string | UnbxdSitekey value |
uid | string | unbxd.userId (Needs to be extracted from the cookie) |
t | string | Timestamp formula: t : current_time | random number between 0 to 1 and t = new Date().getTime() + ‘|’ + Math.random(); |
referrer | string | Link from where the page is opened referrer: sessionStorage.getItem('urlPrevious') || document.referrer || ''; |