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
  • Integrating with Sitecore Personalize
  • Understanding integration details
  • Queueing events using the Engage SDK

Queueing events using the Engage SDK

Using the Engage SDK, you can collect events and send them later in one go. This is useful when, for example, you want to conditionally chain different events depending on which actions your user takes.

To collect events, you can use the event queue. The event queue is a first-in, first-out array stored in session storage in the EngageEventQueue key. You can add any event with a valid payload to the event queue.

Important

The event queue requires that session storage is enabled. Because users can disable session storage, you should use try-catch blocks to handle errors when you're interacting with the event queue.

To interact with the event queue, you can use the following functions:

  • Engage.addToEventQueue() - to add event objects with a valid payload to the event queue.

  • Engage.processEventQueue() - to send all the events in the event queue, in the order the events were added. Then, this function empties the event queue.

  • Engage.clearEventQueue() - to empty the event queue without sending any of the events.

Do you have some feedback for us?

If you have suggestions for improving this article,

Privacy policySitecore Trust CenterCopyright © 1999-2025 Sitecore