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. This can be used on the Cognitive3D dashboard to query how objects are interacted with during a session. 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);