Send a SEARCH event to Sitecore CDP

Abstract

Provides a JSON example of how to send a SEARCH event to Sitecore CDP (Data model 2.0).

The SEARCH event captures the user's action of searching for a product. The SEARCH event must be passed to Sitecore CDP when the search results page loads.

To send a SEARCH event to Sitecore CDP, use the following attributes:

Attribute

Description

Type

Example(s)

Required/optional

channel

The channel captured on each page the guest visited.

string (uppercase)

"WEB", "MOBILE_WEB", "MOBILE_APP"

Required

type

The type of event.

string (uppercase)

"SEARCH"

Required

language

The language captured on each page the guest visited.

string (2 letter ISO 639 language code)

"EN", "FR", "DE"

Required

currency

The type of currency.

string (3 letter ISO 4217)

"EUR", "USD", "GBP"

Required

page

The name of the webpage the guest visited.

string

"home page", "search page" "/home", "/confirm"

Required

pos

The point of sale (storefront) captured on each page the guest visited.

string (predefined by client)

"spinflight.com", "spinair.com"

Required

browser_id

The ID of a browser generated by Sitecore CDP.

string (UUID)

"56860bff-94ba-4d84-aa37-2b5a83d5411b"

Required

product_name

The product name the guest searched for.

string

"DUB-LON"

Required

product_type

The product type the guest searched for.

string (uppercase)

"FLIGHT"

Required

flight_type

The flight type the guest searched for.

string (uppercase)

"OW" for One way, "RT" for Return

Required

origin

The IATA code (airport or city) of the origin the guest searched for.

string (uppercase)

"DUB", "LHR", "BCN"

Required

destination

The IATA code (airport or city) of the destination the guest searched for.

string (uppercase)

"DUB", "LHR", "BCN"

Required

start

The local departure date and time of the flight the guest searched for.

ISO 8601 date/time local time without timezone YYYY-MM-DD’T’hh:mm

"2016-08-21T16:17”

Required

end

The local return date and time of the flight the guest searched for.

ISO 8601 date/time local time without timezone YYYY-MM-DD’T’hh:mm

"2016-08-23T07:00”

Required

adults

The number of adults of the flight the guest searched for.

integer, >=0

2

Required

children

The number of children of the flight the guest searched for.

integer, >=0

2

Required

infants

The number of infants of the flight the guest searched for.

integer, >=0

1

Required

fare_class

The class of flight the guest searched for.

string (title case)

"Economy", "Premium Economy", "Business", "First Class"

Required

fare_family

The fare family of the flight the guest searched for.

string (suggest title case)

"Economy Plus", "Flexi Economy"

Optional

The following JSON example contains a SEARCH event for a FLIGHT product_type:

{
    "channel": "WEB",
    "type": "SEARCH",
    "language": "EN",
    "currency": "EUR",
    "page": "search result page",
    "pos": "spinair.com",
    "browser_id": "56860bff-94ba-4d84-aa37-2b5a83d5411b",
    "product_name": "DUB-LON",
    "product_type": "FLIGHT",
    "flight_type": "RT",
    "origin": "DUB",
    "destination": "LON",
    "start": "2015-01-30T00:00",
    "end": "2015-02-01T00:00",
    "adults": 1,
    "children": 0,
    "infants": 0,
    "fare_class": "Economy",
    "fare_family": "Economy Plus"
}