Skip to main content

Metrics

The Metrics feature in the iXR Platform has two parts:

  1. Metrics Page โ€“ Explore raw metrics visually.
  2. Posting Metrics โ€“ Send new metrics to the API.

๐Ÿ–ฅ๏ธ Metrics Pageโ€‹

Use the Metrics page to filter and inspect raw metrics with a workflow similar to Grafana dashboards.

Metrics page โ€” filters and results

๐Ÿ”Ž Filters & Controlsโ€‹

  • Metric Group โ€“ Choose a group (e.g., Users, Sessions, SettingDeleted).
  • Metric โ€“ Pick a specific metricCode within the selected group (e.g., iXR-Core-userSessionLength).
  • Start Date / End Date โ€“ Time range for your query.
  • Add Filter โ€“ Add extra key/value filters (e.g., DomainUserId, SessionType).
  • Apply โ€“ Runs the query with the selected filters.

๐Ÿงฑ Results Tableโ€‹

  • Metric Name โ€“ The metricโ€™s code.
  • Value โ€“ Parsed or summarized value (e.g., Duration: 8.426751).
  • Domain User โ€“ User identifier when present; N/A if not applicable.
  • Date โ€“ Timestamp (createdAt).

Rows are sortable (โ†‘/โ†“), paginated (Rows per page), and expandable. Expanding a row opens Details, where you can:

  • View the full metricValue payload.
  • Copy values for debugging or reporting.
  • See normalized fields (Metric Name, Value, Domain User Id, Date).

๐Ÿ“ค Posting Metricsโ€‹

The API allows you to submit metrics from your application or users. There are two endpoints:

  1. End Userโ€“Specific Metrics POST app/api/v1/projects/{projectId}/domain/metrics/user

  2. General Application Metrics POST app/api/v1/projects/{projectId}/domain/metrics

๐ŸŽฏ Purposeโ€‹

Submit analytics data either for:

  • A specific end user (user-tied events like sessions).
  • The application in general (system or project-wide events).

๐Ÿงพ Request Headersโ€‹

  • Content-Type: application/json

๐Ÿ“ฆ Request Bodyโ€‹

The request body is always a JSON object with the following fields:

FieldTypeRequired?Description
metricGroupCodestringYesLogical group for the metric (e.g., "Sessions", "SettingDeleted").
metricCodestringYesUnique or descriptive identifier for the metric.
createdAtstringNoISO-8601 timestamp when the metric was generated. Defaults to server time if omitted.
metricValueobjectYesKeyโ€“value payload storing the metric (any valid JSON structure).

Notes

  • If createdAt is omitted, the server sets it to the current date and time.
  • metricValue is stored as JSONB in the database.

๐Ÿงช Example Requestsโ€‹

End Userโ€“Specific Metrics

{
"metricGroupCode": "Sessions",
"metricCode": "Session-14/05/2025",
"createdAt": "2024-12-08T08:32:46.003Z",
"metricValue": {
"Start": "2024-12-08T08:32:46.003Z",
"SessionType": "normal"
}
}

๐Ÿงญ Summary & Behaviorsโ€‹

โฑ๏ธ Timestamp Handlingโ€‹

  • If createdAt is not provided, the server defaults to the current time.
  • Supports both online (real-time) and offline (batched) submissions.

๐Ÿ—ƒ๏ธ Metric Value Storageโ€‹

  • metricValue is stored as JSONB in the database.

๐Ÿงฎ Session Groupingโ€‹

  • Reports can group metrics by a Session field inside metricValue.
  • Unique session IDs are recommended but not enforced; duplicates are allowed and simply affect granularity.

โœ… Best Practicesโ€‹

๐Ÿ•’ Use Accurate Timestamps

Always include createdAt when posting metrics. This ensures consistency across different devices and avoids relying on server defaults.

๐Ÿ“ฆ Keep Metric Groups Organized

Use meaningful metricGroupCode and metricCode values (e.g., "Sessions", "FeatureUsage") so metrics are easier to query and analyze later.

๐Ÿงฎ Unique Session IDs

For session tracking, generate unique IDs per session. While duplicates are allowed, unique IDs improve report granularity and accuracy.

๐Ÿ”‘ Consistent Keys in metricValue

Define a standard schema for keys inside metricValue (e.g., always use "UserId", "Device", "SessionType"). Consistency ensures metrics can be filtered and aggregated easily across different events.

๐Ÿ”Ž Filter-Friendly Values

Design metricValue objects with fields that can be used as filters (e.g., SessionType, Device, UserId) for easier dashboard analysis.

โšก Batch Submissions Wisely

When operating offline, batch metrics carefully and ensure ordering is preserved before posting them to the API.


๐Ÿ’ก Business Caseโ€‹

Business case โ€” Feature Usage Tracking

Imagine your team has launched a new feature in your VR training application. You want to measure how often it is used, by whom, and under what conditions.

  • Each time a user triggers the feature, the app sends a metric event via the API.
  • The metricGroupCode could be "FeatureUsage".
  • The metricCode could be "VR-Scenario-Start".
  • The metricValue could store details such as:
{
"UserId": "12345",
"ScenarioId": "Intro-Level",
"Device": "OculusQuest2",
"StartTime": "2025-09-17T08:30:00Z"
}