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 NameTypeValue to Pass
querystringSuggested query
autosuggest_typestringIN_FIELD autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
autosuggest_suggestionstringSuggested query in Infield
field_namestringThe name of the field used for the IN_FIELD suggestion
field_valuestringThe value of the field in the suggestion
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
visit_typestringEither "first_time" or "repeat"
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
querystringTitle of the product
autosuggest_typestringPOPULAR_PRODUCTS autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
pidstringUnique id of the product, to be taken from the search API response
field_namestringThe name of the field used for the IN_FIELD suggestion
field_valuestringThe value of the field in the suggestion
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp 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,

  1. Fire the autosuggest POPULAR_PRODUCTS event.

  2. Retrieve the pid.

  3. Fire the click event.

CART

  1. Fire the autosuggest POPULAR_PRODUCTS event.

  2. Retrieve the pid.

  3. Fire the click event.

  4. After firing the click event, fire the add to cart event.

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 NameTypeValue to Pass
querystringSuggested query in keywords
autosuggest_typestringKEYWORD_SUGGESTION autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
autosuggest_suggestionstringSuggested query in Infield
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
querystringSuggested query
autosuggest_typestringTOP_SEARCH_QUERIES autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
autosuggest_suggestionstringSuggested query in Infield
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
querystringTitle of the product
autosuggest_typestringPOPULAR_PRODUCTS_FILTERED autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
pidstringUnique id of the product, to be taken from the search API response
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
querystringSuggested query
autosuggest_typestringPROMOTED_SUGGESTION autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
autosuggest_suggestionstringSuggested query in Infield
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
querystringSuggested query
autosuggest_typestringKEYWORD_SUGGESTION autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
autosuggest_suggestionstringSuggested query in Infield
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
unxAsTypestringThis attribute goes into the misc object to indicate this is a type of FIELD_TYPE_SUGGESTION.
unxAsFieldNamestringThis 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 NameTypeValue to Pass
querystringSuggested query in Infield
autosuggest_typestringTOP_SEARCH_QUERIES autosuggest type selected and submitted for search, usually the same as the value of the doctype field in Unbxd autosuggest API
autosuggest_suggestionstringSuggested query in Infield
unbxdprankstringRank of the product from the overall list of suggestions
internal_querystringThe typed query (the current search string prefix) in the search box, which led to the suggestions in autosuggest
urlstringWebsite URL where the search is performed
UnbxdKeystringUnbxdSitekey value
uidstringunbxd.userId (Needs to be extracted from the cookie)
tstringTimestamp formula: `t : current_time \
referrerstringLink 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 NameTypeValue to Pass
unxAsTypestringThis attribute goes into the misc object to indicate this is a type of TRENDING_QUERIES.