Company logo
April 5, 2021

Send CommandBar events to Segment (or another CDP)

Vinay Ayyala's avatar

CommandBar automatically logs analytics events, and now (in addition or instead) you can send them to a customer data platform (e.g. Segment). Use this to capture command executions and deadends.

How can I turn this on? 🛠 If you want to take advantage of this, you can use the new CommandBar.addEventHandler method.

const myHandler = (eventName, eventData) => {    
  sendToSegment({name: eventName, ...eventData}); 
} 
window.CommandBar.addEventHandler(myHandler);

For full details on this new feature, see here.