Skip to content

Sessions

Start and End Sessions

A Session will begin automatically from the BP_Cognitive3DActor in your scene. This is implemented with Blueprints so you can easily modify the behaviour if needed.

A Session can be started with various Properties or you can add Properties later from the SDK while the Session is recording data. End Session is automatically called when the application closes or the editor stops playing. In some cases you may want to manually End a Session - for example if a Participant makes multiple attempts (multiple Sessions) on a training exercise without closing the application. Sessions will persist between different Levels.

Participants should consent to data collection as described in your privacy policy. If you do not wish to record analytics for any reason, simply do not call StartSession.

session begin

if (bAcceptedPrivacyPolicy == true)
{
    TWeakPtr<FAnalyticsProviderCognitive3D> cognitive = FAnalyticsCognitive3D::Get().GetCognitive3DProvider();
    if (cognitive.IsValid())
    {
        //start session
        cognitive.Pin()->StartSession();

        //start session with properties
        TArray<FAnalyticsEventAttribute> properties;
        properties.Add(FAnalyticsEventAttribute("store", "main street"));
        cognitive.Pin()->StartSession(attributes);

        //end the session
        cognitive.Pin()->EndSession();
    }
}

Session Name

You can set a custom name for a Participant's Session. This can be useful for organizing Sessions on the Dashboard and SceneExplorer. If you do not provide a Session name, it will use the Participant Name. If that is also not provided, a Session Name will be generated for you and can be changed on the Dashboard. You can set a Session Name before or after the Session is started.

session name

TWeakPtr<FAnalyticsProviderCognitive3D> cognitive = FAnalyticsCognitive3D::Get().GetCognitive3DProvider();
if (cognitive.IsValid())
{
 cognitive.Pin()->SetSessionName("VR Convention 2018");
}

Session Property

You may have some additional data to record that is relevant to the entire Session. For example, if you have some variable starting parameters, this could be a good place to record those conditions. You can set Session Properties at any time during the experience - but they will overwrite any property with the same name.

session properties

TWeakPtr<FAnalyticsProviderCognitive3D> cognitive = FAnalyticsCognitive3D::Get().GetCognitive3DProvider();
if (cognitive.IsValid())
{
 cognitive.Pin()->SetSessionProperty("starting currency",25.0);
 cognitive.Pin()->SetSessionProperty("store","main street");
}

Session Tags

Session Tags are similar to Properties, but can be used to isolate metrics for specific Sessions. For example, if you are doing A/B testing on a focus group, Tags would be ideal for analyzing a single group at a time. Tags can also be changed on the Dashboard after the Session is complete.

session tags

TWeakPtr<FAnalyticsProviderCognitive3D> cognitive = FAnalyticsCognitive3D::Get().GetCognitive3DProvider();
if (cognitive.IsValid())
{
 cognitive.Pin()->SetSessionTag("group_a");
}