addToEventQueue
|
Type |
Function |
|
Import path |
|
Adds an event with a valid payload to the event queue. After adding events to the event queue, run the event queue using processEventQueue or empty it using clearEventQueue.
FORM events can't be added to the event queue.
Signature
Parameters
|
Name |
Type |
Description |
|---|---|---|
|
|
Required. Data for custom events. Used by |
Return value
Returns a promise.
Examples
Next.js
To run this function, you have to first initialize the Cloud SDK.
Here's an example of how to use the addToEventQueue function to save events to the event queue.
In this scenario, we add different events to the event queue depending on whether a site visitor clicked a dropdown menu and a dropdown menu item.
In the following order, either the DROPDOWN_CLICK then the DROPDOWN_ITEM_CLICK events are added to the event queue, or the DROPDOWN_CLICK then the DROPDOWN_ABANDON events are added.