Skip to content

Custom Events

Custom Events are the primary way Cognitive3D collects telemetry data (user events) from your product.

They can be created with the code below. If a user session is not yet active, the custom event will be recorded and sent after session begins.

c3d.customEvent.send(customName:string, position:array, prop:object/*optional*/);

Simple Custom Event:

const pos = [0,0,0]; /// x,y,z coordinates of where the event happened
c3d.customEvent.send('myCustomEvent', pos);

You can also add properties to Custom Events:

const prop = {
    taskTimeElapsed: 60,
    someOtherProperty: 'someValue'

c3d.customEvent.send('userCompletedTask', pos, prop);