---
title: "Extension data object"
slug: "extension-data-object"
abstract: "Describes the extension data object in the Sitecore Engage SDK (Sitecore CDP Stream API)."
---
# Extension data object

Use the extension data object to collect custom data about an event that you then send to Sitecore CDP. This is an optional object that you can specify as the last function argument when you [send events](https://doc.sitecore.com/cdp/en/developers/api/integrating-with-sitecore-cdp/understanding-integration-details/sending-events-using-the-engage-sdk.html "Sending events using the Engage SDK"). This object accepts a maximum of 50 custom attributes of your choice.

After you send the event, the data in this object becomes available in the [event](https://doc.sitecore.com/cdp/en/developers/api/integrating-with-sitecore-cdp/understanding-integration-details/viewing-events-in-sitecore-cdp.html "Viewing events in Sitecore CDP"), but not in the guest profile.

When you build this object, use a flat object structure. Sitecore CDP automatically flattens nested objects and renames the keys as necessary. For example:

Nested object:

`{"params":{"customObject":{"number":"16"}}}`

Flattened object with renamed key:

`{"params_customObject_number":"16"}`

Here's an example of how to use the `event()` function to send a custom event called `myretailsite:CLICKED_POPUP`. `eventData` contains all the [required attributes for the event data object](https://doc.sitecore.com/cdp/en/developers/api/stream-api/sitecore-engage-sdk-reference/objects/event-data-object.html#UUID-a7f441ce-7bee-9e1a-8a6c-7f995310e71b_UUID-2cda931f-8a8a-520d-dd7c-fe7fa3c3d597 "Required attributes"). `extensionData` contains the custom data.

```javascript
import { engage } from "./engage.js";
// ...

const handleClick = async (e) => {
    e.preventDefault();

    const eventData = {
      channel: "WEB",
      currency: "EUR",
      pointOfSale: "myretailsite/ireland",
      language: "EN",
      page: "home"
    };

    const extensionData = {
      customKey: "customValue"
    };

    await engage.event("myretailsite:CLICKED_POPUP", eventData, extensionData);
};

```