Skip to main content
Users
CloudPortalLogin
  • Powered byPowered by
Developing with Sitecore Personalize
Data privacy
Before you start sending data
Integrating with Sitecore Personalize
Stream API
Personalize API Flow execution
REST APIs
  • Sitecore Personalize for developers
  • Stream API
  • Boxever JavaScript Library (legacy) reference
  • Functions
  • Boxever.eventCreate(event, callback, format)

Boxever.eventCreate(event, callback, format)

The eventCreate() function sends an event to Sitecore Personalize. 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 Personalize 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 Personalize. 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 Personalize.

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

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2025 Sitecore