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 session is not yet active the custom event will be recorded and sent after the session begins.

 //the position in the scene where this custom event happens
 std::vector<float> pos = { 0,0,0 };
 cog->GetCustomEvent()->RecordEvent("Toggle Music",pos);

 //custom events support arbitrary properties
 cognitive::nlohmann::json properties = cognitive::nlohmann::json();
 properties["volume"] = -21;
 cog->GetCustomEvent()->RecordEvent("Set Music Volume",pos,properties);

Custom Events can reference a Dynamic Object Id. To analyze how dynamic objects are interacted with during a session, you can utilize this feature on the Cognitive3D dashboard. See the Dynamic Objects page for details about how to acquire the Dynamic Object Id.

 std::string dynamicObjectId = "asdf1234";
 std::vector<float> pos = { 0,0,0 };

 cog->GetCustomEvent()->RecordEvent("Grab", pos, dynamicObjectId);

intercom If you have a question or any feedback about our documentation please use the Intercom button (purple circle) in the lower right corner of any web page.