Skip to content

Session properties

Each session recorded on the device has standard properties (automatically collected by the SDK) and applications can also send custom session properties.

Overview

You can create custom properties that are inserted into sessions at run-time. Each session property is only stored once per session, meaning the last session property value sent for a given key is the one stored with the session. This is in contrast to Events, which can be sent multiple times during a session and all events with the same key will be stored in the session with their timestamps and properties.

Session property details

You add properties to a session using SessionProperties. For example, if you are testing a QA build and want to be able filter between sessions in the C3D dashboard, you could set a session property called testSession with a Boolean value of True.

Cognitive3DAnalyticsCore.shared.setSessionProperty(key: "testSession", value: True)

Properties can be added at any time during a session; the data gets included with the gaze data stream. The supported value types are: String, Boolean, Numeric.

Cognitive3DAnalyticsCore.shared.setSessionProperty(key: "myKey1", value: "Jibber Jabber")
Cognitive3DAnalyticsCore.shared.setSessionProperty(key: "myKey2", value: True)
Cognitive3DAnalyticsCore.shared.setSessionProperty(key: "myKey3", value: 42)

Note: the data is cleared at the end of a session.

Participants as Session properties

Participant ID and names are considered optional session properties. They are useful to differentiate between sessions on the dashboard and associate sessions from the same Participant (user) together.

The core data to submit is:

*name : the full name of the participant *participantId : an unique id for the participant

let idValue = "11112222"
Cognitive3DAnalyticsCore.shared.setParticipantId(idValue)
let fullName = "Jack Jones"
Cognitive3DAnalyticsCore.shared.setParticipantFullName(fullName)

The participant API is using setSessionProperty internally.

You can also add custom data that gets associated with a participant.

Cognitive3DAnalyticsCore.shared.setParticipantProperty(keySuffix: "someAttribute", value: "someValue")

The data gets posted with the key starting with c3d.participant.; the key suffix is appended to it.

intercom If you have a question or any feedback about our documentation please use the Intercom button (purple circle) in the lower right corner of any web page or join our Discord.