HomeGuidesChangelog
Log In
Guides

Search bar dropdown

Definition

A Search bar dropdown shows relevant products as the user types their keyword.

A new call should be made each time the predicted keyword changes.


Parameters

event-type

Value: viewSearchBar

Description: Indicates to the API that this is a search bar dropdown event.

Required: Yes


page-id

Description: An identifier that tells Criteo which placements to return (if any) for the ad request. Placements are instantiated by your Technical Account Manager depending on your desired ad configuration. Below are the standard page-ids for this page type:

  • In Americas: Typically follows the structure [event-type]_API_[environment], e.g., viewSearchBar_API_desktop, viewSearchBar_API_mobile, viewSearchBar_API_android, viewSearchBar_API_iOS.
  • In EMEA: Typically follows the structure [event-type]Api[environment], e.g., viewSearchBarApiDesktop, viewSearchBarApiMobile, viewSearchBarApiAios, viewSearchBarApiAa.

Required: Yes


keywords

Description: The search query entered by the user. If possible, send the final predicted keyword being matched for the organic results. For example, if by typing "app" the keyword being matched is app store, send app store in the API call. If the user then types "appl" and the predicted keyword changes to apple, make another call with apple in the API call. All keywords should be URL encoded.

Examples:

  • black%20laptops
  • black+laptops

Required: Yes


page-uid

Description: This value is returned within the response of the initial call made on page load. By storing this value and including it in subsequent viewSearchBar event calls, Criteo is able to link the events to the initial ad request.

Example: 58d1ebf6-543e-4285-b9dce2f772d1f18f

Required: Yes


Sample calls

📘

The header values in the sample calls are illustrative. Make sure to replace them with the appropriate values for your implementation.


Search bar dropdown example (AMER)

curl -X GET "https://d.us.criteo.com/delivery/retailmedia" \
--data-urlencode "criteo-partner-id=12345" \
--data-urlencode "environment=d" \
--data-urlencode "retailer-visitor-id=a1b2c3d4e5" \
--data-urlencode "customer-id=123456789" \
--data-urlencode "page-id=viewSearchBar_API_desktop" \
--data-urlencode "event-type=viewSearchBar" \
--data-urlencode "keywords=black laptops" \
--data-urlencode "page-uid=58d1ebf6-543e-4285-b9dce2f772d1f18f" \
-H "Referer: https://www.criteo.com" \
-H "X-Forwarded-For: 123.456.789.012" \
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"

Search bar dropdown example (EMEA)

curl -X GET "https://d.eu.criteo.com/delivery/retailmedia" \
--data-urlencode "criteo-partner-id=12345" \
--data-urlencode "environment=d" \
--data-urlencode "retailer-visitor-id=a1b2c3d4e5" \
--data-urlencode "customer-id=123456789" \
--data-urlencode "page-id=viewSearchBarApiAios" \
--data-urlencode "event-type=viewSearchBar" \
--data-urlencode "keywords=black laptops" \
--data-urlencode "page-uid=58d1ebf6-543e-4285-b9dce2f772d1f18f" \
-H "Referer: https://www.criteo.com" \
-H "X-Forwarded-For: 123.456.789.012" \
-H "User-Agent: app_ios 1.2.3"