Personalization
In this example, you see the recently executed search for red dress, followed by popular keywords. For more on Search As You Type and how to bring back the Navigations, please see the SAYT documentation.
Sample query
This query relies on 3 factors:
-
The
sessionId,visitorId, orloginIdif you wish to make the recent searches more sticky. Picking the shortest one (sessionId) will reduce how long the suggested searches stick; pickingloginIdwill let you help customers across their devices as long as they are logged in.The exact syntax to filter down to the session ID is:
"matchExact":{"and":[{"visit":{"customerData":{"sessionId":"<current session ID>"}}}]} -
The partial match (
matchPartial) onquery- we will usetop -
The window of how far back we want to look (this can be
day,week, ormonth) - this example usesday
curl -H "Authorization: --clientKey--" -XPOST \
"https://--customerId--.groupbycloud.com/wisdom/v2/events/search" \
-d '{"window":"day","matchPartial":{"and":[{"search":{"query":"top"}}]}, "matchExact":{"and":[{"visit":{"customerData":{"sessionId":"<current session ID>"}}}]}}'In the above example, you must check with a specific session ID to see sample recall.
"status": {
"code": "200",
"message": "OK",
"additionalInfo": "null"
},
"result":{
"window": "day",
"count": "3",
"recent": [
{ "search": {
"id": "id of this search",
"query": "the full query",
"other": "other portions of the search response"
},
"clientVersion": "your beacon version",
"customer": "your customer ID and Area",
"visit": {
"customerData": {
"sessionId": "...",
"visitorId": "..."
},
"generated:": {
"deviceType": "desktop",
"localTime": "...",
"other": "other generated metadata"
}
}
}
]
}count returns the number of events that this customer had with these parameters.
This example only shows the first object in the array that would contain 3 response objects.