Config

The config API lets you read and change RUMvision's runtime configuration.

Requirement: Make sure the RUMvision JavaScript API is enabled. See JavaScript API requirements.

Introduction

Use config when you want to change how the RUMvision JavaScript behaves.

Examples include browser storage consent, device information, storage duration and SPA tracking.

When to configure

Settings that affect initialization should be queued before the RUMvision script starts.

For example:

 window.rumv = window.rumv || function () {
(window.rumv.q = window.rumv.q || []).push(arguments);
};

rumv('config', 'consent_storage', 0);
rumv('config', 'consent_device', 0);
rumv('config', 'ttl', {
storage: 30 * 24 * 60
});

Runtime settings can also be changed later where supported. For example, after your own consent callback:

rumv('config', 'consent_storage', 1);

Using config

Read a value

Pass a configuration key without a new value will return its current value. It could then be used as follows:

const ttl = rumv('config', 'ttl');

If the configuration key does not exist, false is returned.

Change a value

Pass the key and its new value:

rumv('config', 'consent_storage', 0);

You can also pass multiple values:

rumv('config', {
consent_storage: 0,
consent_device: 0
});

Deep merging

When both the current value and the new value are objects, RUMvision merges them instead of replacing the complete object.

For example:

rumv('config', 'ttl', {
storage: 31*24*60
});

Only ttl.storage is changed.

Other properties such as ttl.visit remain intact.

Type protection

An existing configuration value can only be overwritten with the same value type.

This works:

rumv('config', 'ttl', {
storage: 31*24*60
});

This does not:

rumv('config', 'ttl', 'foobar');

RUMvision returns false and keeps the existing value unchanged.

Strings, numbers, booleans, arrays, objects and null are treated as separate types.

Storage

If enabled by default via a domain's features, browser storage, browser storage can be read or changed.

rumv('config', 'consent_storage');
// 1

To prevent RUMvision from using its own sessionStorage and localStorage, one can disable it from the start:

rumv('config', 'consent_storage', 0);

After your own consent callback approves storage, you can dynamically change the value:

rumv('config', 'consent_storage', 1);

When storage is allowed, RUMvision can persist its session and visit state.

This helps RUMvision distinguish unique/cold and successive/warm page loads more accurately, maintain pageview counts and avoid recollecting some stable information on every pagehit.

If consent is revoked while RUMvision is running:

rumv('config', 'consent_storage', 0);

RUMvision removes its stored session, local and persisted visit data. To prevent tracking any further pagehits within a session, the RUMvision dnt callback can be used.

Device information

The device information feature is disabled by default. When enabled, it will start tracking device information right away, unless specified differently at runtime.

When device information is enabled by default, it will return:

rumv('config', 'consent_device');
// 1

Disable it before initialization via:

rumv('config', 'consent_device', 0);

When disabled, RUMvision does not retain additional device information such as a full browser version or detected device model for regular RUM reporting.

It can be enabled later:

rumv('config', 'consent_device', 1);

When possible, newly approved device information is then added to the current session data.

Private browsing

Where the relevant module is available, best-effort private-browsing detection can be disabled:

rumv('config', 'consent_private', false);

This signal does not delay the first beacon.

CMP status

Supported CMP integrations can read consent status unless disabled:

rumv('config', 'read_cmp_status', false);

This only has an effect when a compatible CMP integration is included.

TTL

All TTL values are configured in minutes.

Get the current values:

rumv('config', 'ttl');

The current defaults are equivalent to:

{
visit: 30,
storage: 129600
}

Visit

Default:

30

This is the visit inactivity timeout.

For example, to expire a visit after 45 minutes of inactivity:

rumv('config', 'ttl', {
visit: 45
});

Storage

Default:

129600

This equals 90 days.

ttl.storage controls the lifetime of persistent first-party RUMvision state when storage consent is enabled.

The value is configured in minutes and can be shorter or longer than 90 days.

For 30 days:

rumv('config', 'ttl', {
storage: 30 * 24 * 60
});

For 180 days:

rumv('config', 'ttl', {
storage: 180 * 24 * 60
});

Choose a duration that fits your own privacy policy, consent implementation and legal basis.

Existing persisted state is evaluated against the configured lifetime when it is read.

Multiple TTL values

Because configuration objects are deep-merged, you can update multiple TTL values together:

rumv('config', 'ttl', {
visit: 45,
storage: 30 * 24 * 60
});

Omitted properties keep their current value.

SPA

isSpa

SPA and soft-navigation support is enabled in the current build:

rumv('config', 'isSpa');
// true

Disable it with:

rumv('config', 'isSpa', false);

This affects soft-navigation handling and soft-navigation reporting through the web-vitals integration.

Configure it before initialization so observers are created with the intended behavior.

flushOffset

Default:

3

RUMvision can keep multiple navigation states in memory so late metrics such as CLS and INP can still be attributed to the correct request.

flushOffset determines how many newer navigations may exist before an older navigation is flushed as stale:

rumv('config', 'flushOffset', 3);

This is an advanced setting and normally does not need to be changed.

evictOffset

Default:

10

evictOffset determines when an older navigation can be removed from memory:

rumv('config', 'evictOffset', 10);

It should normally be larger than flushOffset.

Other config

Engagement

The engagement timeout defaults to:

30000

The value is in milliseconds.

Change it with:

rumv('config', 'engagement', {
timeout: 60000
});

Because the object is deep-merged, other engagement settings remain intact.

Preflight

The default preflight delay is:

20

The value is in milliseconds.

RUMvision uses this short delay to batch early metrics before an early/preflight send.

rumv('config', 'preflight', {
delay: 30
});

This is an advanced transport setting and normally does not need to be changed.

PII sanitization

RUMvision contains client-side regex sanitization for selected request fields.

Inspect the active configuration with:

rumv('config', 'pii');

The configuration can contain:

  • pii.regexes, containing patterns and replacement labels;
  • pii.fields, containing fields to which sanitization is applied.

Because objects are deep-merged, additional regex patterns can be added without replacing the complete configuration.

To prevent site owners from specifying a set of regular expressions at runtime, regular expressions can be configured via their domain settings.

Debug

Inspect the current debug value:

rumv('config', 'debug');

Or enable it explicitly:

rumv('config', 'debug', true);

Available debug output depends on the modules included in the generated script.

Plugins

Some RUMvision features are implemented as optional plugins.

Their configuration only exists when the corresponding module is included for the domain.

Errors

When error tracking is enabled, configuration can include:

  • sanitization;
  • breadcrumbs;
  • captured error categories;
  • hostname labels;
  • processing limits;
  • transport behavior;
  • exclusion rules.

Inspect it with:

rumv('config', 'errors');

Enabled plugins can also expose their own public runtime configuration API. Use that plugin-specific API when documented because it can validate and apply changes itself.

Responsiveness

When the responsiveness module is enabled, configuration can cover interaction and LoAF collection, classification thresholds, URL attribution, processing and transport.

Inspect it with:

rumv('config', 'responsiveness');

Some options are initialization-only because they determine which listeners and observers are installed.

Conversions

When conversion tracking is enabled, its configuration contains the generated events and goals for the property.

Inspect it with:

rumv('config', 'conversions');

Generated conversion definitions should normally be managed through RUMvision or the conversions API instead of being overwritten wholesale.

Plugin availability

Creating a missing plugin config key does not load or enable that plugin.

For example, this does not enable error tracking if the errors module is not included:

rumv('config', 'errors', {});

Internal config

Values such as tag and endpoint also exist in the runtime configuration because RUMvision needs them internally.

They should normally not be changed through the public API.

  • tag identifies the RUMvision property/domain configuration.
  • endpoint is the RUMvision collection endpoint.

Changing either can prevent data from being attributed or delivered correctly.

The config API can technically accept a previously unknown key, but that key has no effect unless a RUMvision module reads it.

Only documented settings should therefore be treated as supported behavior.

Config overview

OptionDefaultUnit/typePurpose
consent_storage1boolean-like numberAllow RUMvision browser storage
consent_device1boolean-like numberAllow additional device information
consent_privateenabledbooleanAllow best-effort private-browsing detection
read_cmp_statusenabledbooleanRead supported CMP status
ttl.visit30minutesVisit inactivity timeout
ttl.storage129600minutesPersistent first-party storage lifetime
preflight.delay20millisecondsEarly metric batching delay
isSpatruebooleanEnable SPA/soft-navigation handling
flushOffset3navigationsFlush older SPA navigation state
evictOffset10navigationsRemove older navigation state
engagement.timeout30000millisecondsEngagement timeout
piiobjectobjectPII sanitization
debugquery-dependentbooleanRuntime debug behavior