Autosuggest Events and Attributes
Autosuggest events and attributes
IN_FIELD
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"IN_FIELD",
"autosuggest_suggestion":"{{suggested-query}}",
"field_value":”value”,
"field_name":”categoryPath1”,
"unbxdprank":”2”,"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}","referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666830840426|0.12139712486982823
Refer here for our sample API
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Suggested query |
autosuggest_type | string | IN_FIELD autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
autosuggest_suggestion | string | Suggested query in Infield |
field_name | string | The name of the field used for the IN_FIELD suggestion |
field_value | string | The value of the field in the suggestion |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
POPULAR_PRODUCTS
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"pid":"{{uniqueId-of-the-product}}",
"qty":"{{quantity-selected}}",
"price":"{{unit-price-for-product}}",
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=order
&uid={{uid}}1658904085468-92302
&t=1662367087116|0.07798836811209986
Refer here for our sample API
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Title of the product |
autosuggest_type | string | POPULAR_PRODUCTS autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
pid | string | Unique id of the product, to be taken from the search API response |
field_name | string | The name of the field used for the IN_FIELD suggestion |
field_value | string | The value of the field in the suggestion |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
The CLICK event and CART event will be be applicable to POPULAR_PRODUCTS.
CLICK
When a popular product is clicked from the autosuggest widget,
-
Fire the autosuggest
POPULAR_PRODUCTSevent. -
Retrieve the
pid. -
Fire the click event.
CART
-
Fire the autosuggest
POPULAR_PRODUCTSevent. -
Retrieve the
pid. -
Fire the
click event. -
After firing the click event, fire the
add to cartevent.
KEYWORD_SUGGESTION
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"KEYWORD_SUGGESTION","autosuggest_suggestion":"{{suggested-query}}",
"unbxdprank":"{{rank-of-product}}",
"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666830840426|0.12139712486982823
Refer here for our sample API
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Suggested query in keywords |
autosuggest_type | string | KEYWORD_SUGGESTION autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
autosuggest_suggestion | string | Suggested query in Infield |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
TOP_SEARCH_QUERIES
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"TOP_SEARCH_QUERIES",
"autosuggest_suggestion":"{{suggested-query}}",
"unbxdprank":"{{rank-of-product}}",
"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666851030913|0.2127782620243308
Refer here for our sample API
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Suggested query |
autosuggest_type | string | TOP_SEARCH_QUERIES autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
autosuggest_suggestion | string | Suggested query in Infield |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
POPULAR_PRODUCTS_FILTERED
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"POPULAR_PRODUCTS_FILTERED",
"autosuggest_suggestion":"{{suggested-query}}",
"unbxdprank":"{{rank-of-product}}",
"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666851030913|0.2127782620243308
Refer here for our sample API
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Title of the product |
autosuggest_type | string | POPULAR_PRODUCTS_FILTERED autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
pid | string | Unique id of the product, to be taken from the search API response |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
PROMOTED_SUGGESTION
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"PROMOTED_SUGGESTION",
"autosuggest_suggestion":"{{suggested-query}}",
"unbxdprank":"{{rank-of-product}}",
"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666851030913|0.2127782620243308
Refer here for our sample API
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Suggested query |
autosuggest_type | string | PROMOTED_SUGGESTION autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
autosuggest_suggestion | string | Suggested query in Infield |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
FIELD_TYPE_SUGGESTION
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"KEYWORD_SUGGESTION",
"autosuggest_suggestion":"{{suggested-query}}",
"unbxdprank":"{{rank-of-product}}",
"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666851030913|0.2127782620243308
&misc:{“unxAsType”:”FIELD_TYPE_SUGGESTION”,”unxAsFieldName”:”categoryPath1”}
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Suggested query |
autosuggest_type | string | KEYWORD_SUGGESTION autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
autosuggest_suggestion | string | Suggested query in Infield |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
In addition to the attributes mentioned above, some MANDATORY miscellaneous data must also be included. These should be added under the object named misc. Please refer to the table below for the specific attributes to be added under misc.
| Attribute Name | Type | Value to Pass |
|---|---|---|
unxAsType | string | This attribute goes into the misc object to indicate this is a type of FIELD_TYPE_SUGGESTION. |
unxAsFieldName | string | This attribute goes into the misc object to indicate the field on which the FIELD_TYPE_SUGGESTION has been set up. Here, the value can be the field name from the feed. |
Example schema (showcasing only a part of the api): &misc:{“unxAsType”:”FIELD_TYPE_SUGGESTION”,”unxAsFieldName”:”categoryPath1”}
TRENDING_QUERIES
Template API:
https://tracker.unbxdapi.com/v2/1p.jpg
?data={"query":"{{suggested-query}}",
"autosuggest_data":{"autosuggest_type":"TOP_SEARCH_QUERIES",
"autosuggest_suggestion":"{{suggested-query}}",
"pid":"{{uniqueId-of-the-product}}",
"unbxdprank":"{{rank-of-product}}",
"internal_query":"{{original-query}}"},
"url":"{{url-of-the-website}}",
"referrer":”{{reference-link}}”,
"visit_type":"{{first_or_repeat}}",
"visitId":"{{visit-id}}"}
&UnbxdKey={{unbxd-sitekey}}
&action=search
&uid={{uid}}
&t=1666851030913|0.2127782620243308
&misc:{“unxAsType”:”TRENDING_QUERIES”}
Payload details:
| Attribute Name | Type | Value to Pass |
|---|---|---|
query | string | Suggested query in Infield |
autosuggest_type | string | TOP_SEARCH_QUERIES autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API |
autosuggest_suggestion | string | Suggested query in Infield |
unbxdprank | string | Rank of the product from the overall list of suggestions |
internal_query | string | The typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest |
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 \ |
referrer | string | Link from where the page is opened `referrer: sessionStorage.getItem('urlPrevious') \ |
In addition to the attributes mentioned above, some MANDATORY miscellaneous data must also be included. These should be added under the object named misc. Please refer to the table below for the specific attributes to be added under misc.
Example schema (showcasing only a part of the api): &misc:{“unxAsType”:”TRENDING_QUERIES”}
| Attribute Name | Type | Value to Pass |
|---|---|---|
unxAsType | string | This attribute goes into the misc object to indicate this is a type of TRENDING_QUERIES. |
Updated about 1 month ago
