Skip to main content
Availability2017.1 or later

Run API

Control RUM JS lifecycle

Custom Data API

Create app-specific monitoring data

Create a Transaction

Time custom user activities

Create a Log

Write custom monitoring logs

User Monitoring & Session Replay APIs

Overview

GermainUX RUM JS provides JavaScript APIs that allow developers to control User Monitoring and generate custom monitoring data directly from a monitored web application. The APIs are organized into two main groups: These APIs are useful when an application requires monitoring behavior or business context beyond the standard RUM JS configuration.

Run API

The Run API allows an application to control the RUM JS monitoring lifecycle. Available operations include:
  • Start Monitoring
  • Stop Monitoring
  • Uninstall Monitoring

Start Monitoring

User Monitoring normally starts automatically after the germainapm.js script has been downloaded and loaded by the monitored application. Therefore, start() does not normally need to be called explicitly. Use it when monitoring has previously been stopped using germainApm.stop().

Parameters

Example

Stop Monitoring

Use stop() to immediately stop User Monitoring.
Stopping monitoring:
  • Uninstalls the active monitoring instrumentation.
  • Does not remove the germainApm code from the monitored page.
  • Does not immediately flush collected data.
  • Allows monitoring to restart following the next full server-side page load, such as a hard navigation or browser refresh.

Parameters

Example

Uninstall Monitoring

Use uninstall() to stop monitoring, flush available data from the browser cache, and optionally clear the monitoring state.
Internally, uninstall() calls:
A custom logout-event generator should use:
Monitoring can restart on the next full server-side page load.

Parameters

Custom Data API

The Custom Data API allows developers to generate organization- or application-specific monitoring data. Custom data can be created as:
  • UX Events
  • Metrics
  • Transactions
  • Logs
This makes it possible to add application-specific and business-specific context to the data automatically captured by GermainUX. For example, an application could generate custom data for:
  • Login activity
  • Checkout steps
  • Add-to-cart actions
  • Search activity
  • Workflow milestones
  • Business errors
  • Application states
  • Processing durations
  • Custom performance measurements

Create an Event

Use createEvent() to create a custom UX Event.
The generated data is associated with the Browser Event KPI.

Parameters

Example

Create a Metric

Use createMetric() to create a custom UX Metric with a numeric value.
The generated data is associated with the Browser Metric KPI.

Parameters

Example

Create a Transaction

Use a custom Transaction when you want to measure a user or application activity that has a duration. The generated data is associated with the Browser Transaction KPI. GermainUX supports two approaches:
  1. Provide the duration directly.
  2. Allow GermainUX to calculate the duration between start and end markers.

Transaction with a Known Duration

When the duration is already known, use:

Parameters

Example

Transaction with a Calculated Duration

When the duration is not known in advance, use startTransaction() and endTransaction().

Start Transaction

End Transaction

The same transaction name must be used to start and end the transaction.

Example

This allows GermainUX to calculate the transaction duration automatically.

Create a Log

Use germainApm.log() to generate a custom internal monitoring log event.
Logs can be accessed from the monitored window through:
To collect logs, configure the following RUM JS settings in the Init Script:
Collected log data is associated with the Germain Agent Debug KPI.

Parameters

‼ Log an Error

For example:

Log Trace Information

For example:

Using Custom Data with Session Replay

Custom Events, Metrics, and Transactions provide additional application and business context for User Monitoring. For example: User starts checkout ↓ Application calls:
↓ GermainUX captures the event in the user’s monitoring context ↓ The event can be analyzed using the applicable KPI and correlated with the user session. This is useful when an important business action cannot be reliably identified from standard browser activity alone.

Choosing the Appropriate Custom Data Type

For example: Customer clicked Place Order → Event Shopping cart contains 7 products → Metric Checkout took 4.8 seconds → Transaction Checkout JavaScript function threw an exception → Log

Validate Custom Data

After implementing an API:
1

Deploy the change in a test or non-production environment

2

Start a monitored session

3

Execute the application workflow that calls the API

4

Confirm that the expected custom data reaches GermainUX

5

Verify the associated KPI

6

Confirm the event, metric, or transaction contains the expected details

7

Open the associated user session when applicable

8

Confirm that the custom data correlates with the expected user activity

9

Validate that sensitive information is not included in custom details objects

Security & Privacy

Custom API calls can include application-specific information through their details objects. Do not send passwords, authentication tokens, secrets, payment information, or other sensitive information through custom monitoring data. Before production deployment:
  • Review the information included in custom data.
  • Minimize personally identifiable information.
  • Apply applicable masking and privacy requirements.
  • Validate access permissions.
  • Avoid exposing credentials or secrets in logs.
  • Test custom API calls with controlled sessions.

Additional Resources

Get Help

Contact GermainUX Support

The Germain Team can help you set this up.

Can't find what you need?

Search all GermainUX docs with Ctrl + K, or use the feedback buttons at the bottom of this page to tell us what is missing.

The content of this document is proprietary to GERMAIN SOFTWARE.