Please follow the steps to send Coveo custom events to Coveo cloud by using coveoua.js

1. Get a Coveo API key from Coveo Cloud interface and make sure that this API key has required privileges.
2. Please follow this link to create a Key How to create Coveo API key
3. Once you got an API key , please make use of it as shown in the below code

var coveoAnalyticsclient = new coveoanalytics.analytics.Client({
token: 'xxxxxxxxxxxxxxxxxxxxxxxx'
});

4. Prepare some custom data object having some key and value pairs to make use in Coveo cloud as Metrics and dimensions for reports

var customData = {
EventType: 'Custom Click',
TitleName: 'Page Title'
};

5. use the below object to fire the custom event

coveoAnalyticsclient.sendCustomEvent({
eventType: "sendCustomEvent", eventValue: 1,language: "en",
customData: customData, sourceName: 'Coveo index source name',
originLevel1: 'search hub name'
});

6. After trigger , you will get a response. Click on F12 and look at Network Tab in browser. The below snap is from Chrome

7. Go to Coveo Cloud¬† and navigate to “Visit Browser” and look at the below events

Categories: Coveo

Leave a Reply

Your email address will not be published. Required fields are marked *