Full API List

All initialization settings and functions for Metalitix are listed below.

The example component below illustrates how to instantiate Metalitix with additional settings and call its functions.

public class ExampleMetalitixTrackerHandler : MonoBehaviour
{
    [SerializeField] private MetalitixLogger logger;
    [SerializeField] private MetalitixCamera metalitixCamera;

    private void Start()
    {
        logger.Initialize(metalitixCamera, '111.222.333.0', 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
        logger.StartSession();
        logger.LogEvent('Statuses', 'Started');
    }
}

Global Settings

SettingDescription

Use Debug Mode

If true, logs all messages to console (server callbacks, errors, etc.).

Inactivity Interval

Amount of user inactivity time, in seconds, after which the session will be automatically closed. By default, the session will close after 2 minutes.

API Key

The API key from your project settings on the Metalitix website.

Initialization Settings

The order of the parameters in the Initialize() function corresponds to the order they appear in the table below.

SettingDefault

camera The MetalitixCamera representing the session's camera.

undefined

clientIPAddress The String IP address of the session used only to determine the session’s country. By default, the server automatically obtains an anonymized IP address (x.x.x.0) to calculate the country. IP address is never saved.

undefined (Automatically Calculated)

apiKey The String API key of this project from the Metalitix dashboard. By default, this is obtained from the dropdown settings.

The API Key from Global Settings

Functions

FunctionParametersReturns

InactivityListeners Adds a callback when a session is automatically stopped due to inactivity.

function callback - The function to run when a session becomes inactive.

None

ClearAttribute() Resets the attribute value recorded by this session to the respective chart.

String chart - The name of the chart that session attribute is recorded to.

None

ClearAttributes() Resets all attribute values recorded by this session to any charts.

None

None

ClearInactivityListeners() Removes all inactivity callbacks set by the user.

None

None

EndSession() Stop sending data, close the session, and clear any session attributes (custom metrics).

boolean clearAttributes = true (Optional) - Whether to clear any session attributes.

None

ForceSend() Manually trigger sending all data to Metalitix backend.

None

None

IsRunning() Checks whether the session is actively sending data.

None

true - The session is actively recording and sending data. false - The session is not recording or sending data because it has paused or ended.

LogEvent() Best for representing user-generated actions. These will also appear in the Sessions tab.

String chart - The name of the chart to record to. String value The value to record to the chart (string only).

None

LogState() Best for recording and monitoring general updates to sessions. These are similar to events but do not appear in the Sessions tab.

String chart - The name of the chart to record to. String|boolean|int value The value to record to the chart.

None

PauseSession() Stop recording and sending data, but do not close the session.

None

None

ResumeSession() Start recording and sending data again with the existing, current open session.

None

None

ShowSurvey() Immediately send a prompt to the user that asks for their sentiment.

None

None

SetAttribute() Used for tagging a session with characteristics. Effectively, only the last value recorded by this session to this chart will appear.

String chart - The name of the chart to record to. String|boolean|int value The value to record to the chart.

None

StartSession() Start automatically recording and sending data to Metalitix, which also notifies the platform that a new session has started.

None

None

Last updated