Search Interactions
| Interaction Name | Description |
|---|---|
| category-search | Captures an event that occurs when a user selects a category during a search. Available in package version 1.3 and later. |
| search | Captures a search event on your site. |
Fields
| Field | Type | Details |
|---|---|---|
| attributes | object | A dictionary of values that you supply. |
| categoryId | string | The ID of a category from a commerce site that the site visitor selects. Must be classified as a category-based search. |
| name | string | Required. The event name. |
| searchQuery | string | A value that the site visitor supplies representing a search query. |
Search Event
1event.target.dispatchEvent(
2 new CustomEvent('experience_interaction', {
3 bubbles: true,
4 composed: true,
5 detail: {
6 name: 'search',
7 searchQuery: input7.value,
8 attributes: {
9 searchFacetList: ['color', 'size'],
10 searchType: ['product'],
11 numberOfResultsRequested: 12,
12 resultPageOffset: 10,
13 sortType: 'asc',
14 correlationId: 'X-239-22-0',
15 },
16 },
17 })
18);