Skip to main content

Creating custom events

Events are used for crafting precise When conditions used in targeting.

If you use a CDP or analytics provider like Segment that captures many user events, you should connect Command AI so that Command AI has access to them.

If you want to wire up custom events to send to Command AI, you can use the simple trackEvent SDK method.

// This example would track "product viewed" event and includes optional event data.
window.CommandBar.trackEvent("product_viewed", {
productId: "A123",
category: "electronics"
});