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
  • Boxever JavaScript Library (legacy) reference
  • Objects
  • Event object
  • Custom events

Custom events

The event object for a custom event must include all the required attributes for event objects. Set the value of the type attribute to a custom event name of your choice. The custom event name must be different than Sitecore CDP reserved event names.

You can add custom attributes of your choice.

Example

This example describes an event object for a custom event in an integration that uses the Boxever JavaScript Library. The browser_id is set to the value that the Boxever.getID() function returns.

In the type attribute of the event, the custom event name is specified as myretailsite:CLICKED_POPUP. The event contains the custom attributes clickedPopup and timeBetweenPopupAndClick.

RequestResponse
const customEvent = {
    browser_id: Boxever.getID(),
    channel: "WEB",
    type: "myretailsite:CLICKED_POPUP",
    language: "EN",
    currency: "EUR",
    page: "home",
    pos: myretailsite/ireland,
    clickedPopup: isPopupClicked(), // true or false
    timeBetweenPopupAndClick: `${getTimestampPopup() - getTimestampClick()} ${timeUnit}` // for example, "8 seconds"
};

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2026 Sitecore