Custom Events

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

Custom Events automatically record x,y,z coordinates. If the position is not provided, it will use the position of the HMD. This allows us to map every single Custom Event to a specific point in your VR experience. In conjunction with visual telemetry (gaze tracking), coordinates gives you the ability to map out how your users are interacting with your product at a 3d space.


Custom Events

Custom Events are sent with a line of code:

new CognitiveVR.CustomEvent("Picked up shopping basket").Send();

You can add a custom position to your custom event:

var basketPosition = shoppingBasket.transform.position;
new CognitiveVR.CustomEvent("Picked up shopping basket").Send(basketPosition);

You can also add properties to your Events:

var productPosition = someProduct.transform.position;
new CognitiveVR.CustomEvent("Picked up shopping basket")
      .SetProperties(new Dictionary<string, object> {
        { "Basket Location", "Store Entrance" },
        { "Some Other Property", 100 }
      })
      .Send();

These events can be queried from our Event Query Tool on our Dashboard:

Event Duration

If an event represents an interval of time, rather than something immediate, you can automatically record a 'duration' property. This is likely the intended result of creating a Custom Event in 'Update'. That method will result in thousands of data points without clearly displaying that time interval

Simply delare a Custom Event variable when the event starts and call Send when the event ends:

// Item.cs
using CognitiveVR;

private CustomEvent holdEvent;

public void PickupItem()
{
  // Some code to pickup the item
  // ...
  holdEvent = new CustomEvent("Product Grabbed");
}

public void DropItem()
{
  // Some code to drop the item
  // ...
  if (holdEvent != null)
  {
    holdEvent.Send(transform.position);
    holdEvent = null;
  }
}

Object Events (Basic)

ObjectEventTable

You can also tag objects in your Custom Events to begin mapping different metrics to your Dynamic Objects. This work very well for things like object purchases, or any custom types of interactions you may have with an object.

Just append the SetDynamicObject(DynamicObjectId) method to your new CustomEvent:

// ShoppingCart.cs
using CognitiveVR;

public void PurchaseItem(GameObject product) {

  // Some code to purchase an item
  // ...

  var pos = product.transform.position;
  var id = product.GetComponent<DynamicObject>().Id;
  new CustomEvent("Product Purchased").SetDynamicObject(id).Send(pos);
}

This will enable sorting objects by their Events on the Object List page:

Dropdown Results

Object Events (Advanced)

You can also add properties to your object events. This is useful for custom sensors, or any additional data you have on your objects.

Just append the SetProperty("propertyName", propertyValue) method to your new CustomEvent:

// ShoppingCart.cs
using CognitiveVR;

public void PurchaseItem(GameObject product) {

  // Some code to purchase an item
  // ...

  var pos = product.transform.position;
  var id = product.GetComponent<DynamicObject>().Id;
  new CustomEvent("Product Purchased").SetDynamicObject(id).SetProperty("Product Price", 2.99f).Send(pos);
}

This will open up an additional sorting option on the Object List, giving you the average value over this property:

Results

Event Sensors

When recording your Custom Events, you can append the current state of every sensor at that moment. This will be recorded as properties, so will be visible in the Event Query Tool on our Dashboard.

public void PurchaseItem(GameObject product) {
  var pos = product.transform.position;

  //this will append the latest value of every sensor
  new CustomEvent("Product Purchased").AppendSensors().Send(pos);

  var id = product.GetComponent<DynamicObject>().Id;  
  //this will append the latest value of only the heartrate sensor. this can also be used with 'SetDynamicObject'
  new CustomEvent("Product Purchased").AppendSensors("heartrate").SetDynamicObject(id).Send(pos);
}