Transactions

Transactions are the primary way CognitiveVR collects telemetry data (user actions) from your product. Other analytics platforms may have referred to these as events or data points. Calling them transactions allows us to go beyond simple one-off events with no context. Transactions can be instant or take time to complete. Transactions can also have other transactions nested within them. Nested and extended transactions allows our platform to contextualize all of your data at all times. This means that every single data point is tied to other data points, which are in turn tied to users or devices.

There is no need to add custom variables or transactions on our dashboard. Simply send transactions and our platform will automatically contextualize them, no set-up required.

There are three types of transactions: Instant Transaction, Extended Transaction, or a Nested Transaction. All of these transactions work the same, but the more you use Nested and Extended Transactions, the more contextualization you get.

Transactions also automatically record x,y,z coordinates. This allows us to map every single transaction to a specific point in your VR experience. In conjunction with visual telemetry (gaze tracking), transactional coordinates gives you the ability to map out how your users are interacting with your product at a 3d level.

This page explains the concepts of Instant, Extended and Nested Transactions. See Code Reference for technical details

Data Graph


Instant Transactions

These five Blueprint nodes each send instant transactions. The only difference are the parameters sent.

instant

Instant transactions are sent with a this code:

TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider();
cognitive.Get()->transaction->BeginEnd("Ninja Star Thrown");

Result:

Instant Transaction


Extended Transactions

Extended Transactions are longer form transactions that can be anything from in-game purchase events, to boss battles, to actual game sessions. These two pairs of Blueprint nodes Begin and End transactions

extended

In this example, we treat an entire game session as an Extended Transaction. We begin() the transaction when we start our game:

void AnalyticsManager::StartGame()
  {
    TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider();
    cognitive.Get()->transaction->Begin("game");
  }

When the game session is finished, we send our data and .end() the transaction. In this case, we create a simple Dictionary to package our game score and win outcome.

void AnalyticsManager::EndGame(bool didWin)
  {
    TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider();
    cognitive.Get()->transaction->End("game");
  }

Result:

Extended Transaction


Nested Transactions

Nested Transactions combine Instant and Extended transactions. They truly demonstrate the power of CognitiveVR's analytics platform.

Nested Transactions allow you to begin contextualizing your data. Ninja Star Fired is much more valuable data if we know it occurs during level01 and that the user had HitEnemy, true, for example.

You can visualize Nested Transactions as a hierarchy:

Game Transaction (user = "user001") begin()

      Level Transaction (level = 1) begin()

           NinjaStarFired Transaction begin()

                  EnemyHit Transaction beginAndEnd()

            NinjaStarFired Transaction (enemyHit = true) end() 

     Level01 Transaction (won = true) end() 

Game Transaction (score = 100, enemiesKilled = 1, NinjaStarsFired = 1) end() 

By creating Nested Transactions, CognitiveVR is able to tell you that when user001 beat level 1, they had 100 score, killed 1 enemy, and fired 1 ninja star. Over time, you can start slicing this data across thousands of users with different traits. Because users and devices have different traits, you can then answer an array of different questions:

How many points did the average HTC Vive user have on level 1?

or

Among Oculus Rift users, how often did people lose on level 2?

or even more complex:

During which level and at which checkpoint did Oculus Rift users who have NVidia GTX 980 graphics cards experience a complete game crash?

Example:

In this example we start a level, but this time we pass on the level number with a levelNumber integer.

void MyGame::StartLevel(int levelNumber)
  {
    TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider();
    TSharedPtr<FJsonObject> properties = MakeShareable(new FJsonObject);
    properties->SetNumberField("level", levelNumber);
    cognitive.Get()->transaction->Begin("level",properties);
  }

During our Ninja Star function, we can add transactions, knowing full well that this Ninja Star Throw transaction will occur as a child within our level transaction.

void MyPlayer::NinjaStarThrow ()
  {
    TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider();
    cognitive.Get()->transaction->BeginEnd("NinjaStarThrown");
  }

Then we end() the level transaction:

void MyGame::EndLevel(bool didWin)
  {
    TSharedPtr<FAnalyticsProviderCognitiveVR> cognitive = FAnalyticsCognitiveVR::Get().GetCognitiveVRProvider();
    TSharedPtr<FJsonObject> properties = MakeShareable(new FJsonObject);
    properties->SetNumberField("userScore", GetScore());
    properties->SetBoolField("didUserWin", didWin);
    cognitive.Get()->transaction->End("level",properties);
  }

That's all there is to it. You simply add transactions within transactions and our system automatically contextualizes what your users have done. This enables our powerful Slicer tool to bring you powerful insights into your VR games.