Immerse

Reporting

The Immerse SDK reporting module can be optionally included in your project. This provides a facility to create customised reports based on events that occurred during a Session.

Reporting Events

To report an event, a Session must first be joined. Once connected, it is as simple as calling a single static method ImmerseSDK.Reporting.Report.Send

Example 1

ReportCollisions.cs is an example script that will send a reporting event each time a collision occurs with another GameObject.

using ImmerseSDK.Reporting;
using UnityEngine;

/// <summary>
/// A Reporting example that captures every collision with a GameObject
/// </summary>
public class ReportCollisions : MonoBehaviour
{
    /// <summary>
    /// OnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider
    /// </summary>
    private void OnCollisionEnter(Collision collision)
    {
        // Report the collision
        Report.Send("Collision", name, collision.gameObject.name);
    }
}

xAPI Data

When you send a reporting message you can also send xAPI Data, using xAPI allows the data from the session to be used in any system that uses a learning record store such as an LMS. The Immerse platform will display the xAPI data with your reporting messages and it can be exported out manually or can be sent to an LMS. For more info about xAPI check here: https://xapi.com/overview/

using ImmerseSDK.Networking;
using ImmerseSDK.Reporting;

/// <summary>
/// Example on sending xAPI complete message with a score
/// </summary>
public void SendxApiCompleteMessage(float score)
{
    if (Multiplayer.Status == ConnectionStatus.Connected)
    {
        var xApi = new XApiData {Completion = true, Score = score};

        // The first 3 parameters of this can be customized as you like 
        // e.g "UserID" can be replace with Multiplayer.Session.Users.LocalUser.Id to send the local user's ID
        Report.Send("Complete", "User", "UserID", xApi);
    }
}

Reviewing

To review your reporting events, navigate to the Reporting tab under Immerse SDK in Unity's Project Settings and click Refresh to get the latest results. A list of all recent sessions should now appear, with a unique ID and timestamp for each. Click 'Open' to see the report or 'Share...' to generate a shareable link.

📘

Shareable reporting links for your developer session will expire after 1 hour

Updated 2 months ago

Reporting


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.