---
title: "EventData"
slug: "cloud-sdk-events-eventdata-1748079"
abstract: "The EventData interface represents data for custom events."
---
# EventData

|     |     |
| --- | --- |
| Type | Interface |
| Extends | [`EventAttributesInput`](https://doc.sitecore.com/sdk/en/developers/006/cloud-sdk/cloud-sdk-reference/cloud-sdk-events/cloud-sdk-events-browser/interfaces/cloud-sdk-events-eventattributesinput.html "EventAttributesInput") |
| Import path | `@sitecore-cloudsdk/events/server` |

Data for [custom](https://doc.sitecore.com/sdk/en/developers/006/cloud-sdk/cloud-sdk-concepts/concepts-tracking/events/custom-events.html "Custom events") events.

## Signature

```typescript
export interface EventData extends EventAttributesInput, NestedObject {
  type: string;
  extensionData?: ExtensionData;
  searchData?: NestedObject;
}
```

## Properties

| Name | Type | Description | Value |
| --- | --- | --- | --- |
| type | string | Required.The type of the event.To send a custom event using event, or to add a custom event to the event queue using addToEventQueue, set type to a unique value. Do not set type to a reserved event name.Recommendation: Include the name of the site in the unique value, for example, "myretailsite:CLICKED_PROMO".Reserved event names:Any event name starting with "SC_"."ADD" - standard ADD event."ADD_CONSUMERS" - standard ADD_CONSUMERS event."ADD_CONTACTS" - standard ADD_CONTACTS event."CAMPAIGN_TRACKING" - internally reserved event. Do not use."CHECKOUT" - standard CHECKOUT event."CLEAR_CART" - standard CLEAR_CART event."CONFIRM" - standard CONFIRM event."FEEDBACK" - FEEDBACK event."IDENTITY" - standard IDENTITY event."INTERACTION" - internally reserved event. Do not use."ORDER_CHECKOUT" - standard ORDER_CHECKOUT event."PAYMENT" - standard PAYMENT event."SUBSCRIPTION" - internally reserved event. Do not use."SEARCH" - standard SEARCH event."TRACKING" - internally reserved event. Do not use."VIEW" - standard VIEW event.To send a standard event using event, set type to the standard event name, such as ORDER_CHECKOUT or SC_SEARCH_WIDGET_VIEW.We recommend that you send standard events using their dedicated functions instead of the event function. For example, send an IDENTITY event using the identity function. | "myretailsite:CLICKED_PROMO" |
| extensionData | ExtensionData | Optional.Any custom data to collect about an event in addition to the other attributes provided for the event data. | { customKey: "customValue" } |
| searchData | NestedObject | Optional.ImportantRequires a Sitecore Search subscription.Sitecore Search data about the event.Use only in the following, standard events:SC_SEARCH_WIDGET_VIEWSC_SEARCH_WIDGET_CLICKIf set, the event and all its data will be available in Sitecore Search.Construct according to the Sitecore Search Events API reference and data model. | N/A |

## Examples

Example 50. Custom event

Here's a basic event data object for a custom event named `"myretailsite:CLICKED_PROMO"`:

```typescript
const eventData: any = {
  type: "myretailsite:CLICKED_PROMO"
};
```

Example 51. Custom event with optional data

```typescript
const eventData: any = {
  type: "myretailsite:CLICKED_PROMO",
  language: "EN",
  page: "home",
  channel: "WEB",
  currency: "EUR",
  extensionData: { customKey: "customValue" }
};
```

Example 52. SC_SEARCH_WIDGET_VIEW event

Here's an example event data object for a `SC_SEARCH_WIDGET_VIEW` event with search data:

```typescript
const eventData: any = {
  type: "SC_SEARCH_WIDGET_VIEW",
  searchData: {
    value: {
      rfk_id: "rfkid_7",
      request: {
        keyword: "SitecoreAI",
        page_size: 9
      },
      context: {
        page: {
          uri: "https://www.sitecore.com/search?phrase=XM+Cloud"
        }
      },
      entities: [{
          id: "https___www_sitecore_com_products_xm-cloud",
          entity_type: "content",
          entity_subtype: "Products"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_americaneaglemigrationaccelerator",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_perficient-xmcloud-jumpstart",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        },
        {
          id: "https___www_sitecore_com_knowledge-center_digital-marketing-resources_migrating-to-xm-cloud",
          entity_type: "content",
          entity_subtype: "Knowledge Center"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_sai-digital-catalyzer-loyalty",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_altudo-composable-commerce-accelerator",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_espire-xm-cloud-accelerator",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_altudo-xm-cloud-accelerator",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        },
        {
          id: "https___www_sitecore_com_partners_solution-catalog_altudo-xm-cloud-workshop",
          entity_type: "content",
          entity_subtype: "Partner Solution"
        }
      ]
    }
  }
};
```

> [!note]
> **XM Cloud is now SitecoreAI**
> Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.

Example 53. SC_SEARCH_WIDGET_CLICK event for an item

Here's an example event data object for a `SC_SEARCH_WIDGET_CLICK` event with search data. This object describes a click event on an item:

```typescript
const eventData: any = {
  type: "SC_SEARCH_WIDGET_CLICK",
  searchData: {
    action_cause: "entity",
    value: {
      rfk_id: "rfkid_7",
      index: 0,
      entities: [
        {
          id: "itemId",
          entity_type: "content"
        }
      ],
      request: {
        keyword: "what is sitecore",
        num_results: 21,
        total_results: 21,
        page_size: 24,
        page_number: 1
      },
      context: {
        page: {
          uri: "https://www.sitecore.com/search?phrase=XM+Cloud"
        }
      }
    }
  }
};
```

Example 54. SC_SEARCH_WIDGET_CLICK event for a facet

Here's an example event data object for a `SC_SEARCH_WIDGET_CLICK` event with search data. This object describes a click event on a facet:

```typescript
const eventData: any = {
  type: "SC_SEARCH_WIDGET_CLICK",
  searchData: {
    action_cause: "filter",
    value: {
      rfk_id: "rfkid_7",
      request: {
        keyword: "SitecoreAI",
        page_size: 9,
        total_results: 766
      },
      context: {
        page: {
          uri: "https://www.sitecore.com/search?phrase=XM+Cloud"
        }
      },
      filters: [{
        name: "product",
        title: "Product",
        value_position: [
          0
        ],
        display_name: [
          "Connect"
        ],
        value: [
          "facetid_eyJ0eXBlIjoiZXEiLCJuYW1lIjoicHJvZHVjdCIsInZhbHVlIjoiQ29ubmVjdCJ9"
        ],
        facet_position: 1
      }]
    }
  }
};
```

Example 55. SC_SEARCH_WIDGET_CLICK event for a suggestion

Here's an example event data object for a `SC_SEARCH_WIDGET_CLICK` event with search data. This object describes a click event on a suggestion:

```typescript
const eventData: any = {
  type: "SC_SEARCH_WIDGET_CLICK",
  searchData: {
    action_cause: "suggestion",
    value: {
      rfk_id: "rfkid_7",
      index: 0,
      request: {
        keyword: "make",
        page_size: 6,
        page_number: 1
      },
      context: {
        page: {
          uri: "https://www.sitecore.com/search?phrase=XM+Cloud"
        }
      },
      filters: [{
        name: "article_name_context_aware",
        title: "Suggestions",
        display_name: [
          "makeup tips for people with glasses"
        ],
        value: [
          "makeup tips for people with glasses"
        ]
      }]
    }
  }
};
```