Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
CDPCloud Portal
Sitecore CDP Developer Documentation
  • Developing with Sitecore CDP
                • VIEW event
                • IDENTITY event
                • SEARCH event
                • Custom events
            • Flow object
        • Troubleshooting
        • Release notes
  1. Event object
  1. Stream API
  2. Objects
  3. Event object
  4. 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.

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"
};
If you have suggestions for improving this article, let us know!

Documentation Assistant

This assistant uses AI to generate responses based on Sitecore documentation. While it has access to official sources, answers may be incomplete or inaccurate and should not be considered official advice or support.
Powered by
k
kapa.ai
Protected by reCAPTCHA

© Copyright 2026, Sitecore A/S or a Sitecore affiliated company.
All rights reserved.

Privacy policySitecore Trust CenterTerms of use