Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Developing with Sitecore CDP
Data privacy
Before you start sending data
Integrating with Sitecore CDP
Stream API
Batch API
REST APIs
Data lake export service
  • Sitecore CDP for developers
  • Stream API
  • Sitecore Engage SDK reference
  • Objects
  • Extension data object

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. 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, 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. extensionData contains the custom data.

RequestResponse
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);
};

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2026 Sitecore