Skip to main content
Sitecore Documentation
  • Learn
  • Downloads
  • Changelog
  • Roadmap
CDPCloud Portal
Sitecore CDP Developer Documentation
  • Developing with Sitecore CDP
            • Boxever.eventCreate(event, callback, format)
            • Boxever.callFlows(flow, callback)
            • Boxever.addUTMParams(event)
            • Boxever.browserCreate(object, callback, format)
            • Boxever.browserShow(browserId, clientKey, callback, format)
            • Boxever.getBucketNumber([callback])
            • Boxever.getClientKey()
            • Boxever.getCookie(cookieName)
            • Boxever.getID()
            • Boxever.reset()
            • Boxever.setCookie(cookieName, cookieValue[, expiresIn])
            • Boxever.templating()
            • Boxever.triggerExperiences()
        • Troubleshooting
        • Release notes
  1. Functions
  1. Stream API
  2. Functions
  3. Boxever.eventCreate(event, callback, format)

Boxever.eventCreate(event, callback, format)

The eventCreate() function sends an event to Sitecore CDP. An event is all the data about a user's interaction with your application. Call this function as part of the anonymous function that you add to the _boxeverq array.

Parameters

Parameter

Type

Description

Note

event

object

All the event data.

Specify the browser ID in this object.

Every event that you send to Sitecore CDP must include the browser ID.

callback

function

This callback function handles the response.

N/A

format

string

The format of the response.

Set the value to "json". Other formats are not supported.

Return value

undefined

Example

This example describes how to send a VIEW event to Sitecore CDP. The _boxeverq array receives an anonymous function. The anonymous function contains a VIEW event object. The eventCreate() function receives the VIEW event object and sends the event data to Sitecore CDP.

_boxeverq.push(() => { 
    const viewEvent = { 
        browser_id: Boxever.getID(),
        channel: "WEB",
        type: "VIEW",
        language: "EN",
        currency: "EUR",
        page: "home",
        pos: "myretailsite/ireland",
    };

    // Send the event data to the server
    Boxever.eventCreate(
        viewEvent, 
        response => console.log(response),
        "json"
    );
});
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