Skip to main content

setRecordingSettings

Creates or updates recording targeting, masking, and sampling settings for an editable site and returns the saved configuration. Marks recording ratios for recalculation and requests a tracking script refresh. Use setSiteRecording to toggle recording itself. Requires recordings settings access.

setRecordingSettings(
siteId: Int
pageTargetingEnabled: Boolean
endSessionOnBlockedUrl: Boolean
urlMatchingRules: String
blockedUrlMatchingRules: String
maskElements: String
samplingType: SamplingType
samplingValue: Float
): RecordingSettings!

Arguments​

setRecordingSettings.siteId ● Int scalar​

Site ID from sites; required even though the schema marks it optional.

setRecordingSettings.pageTargetingEnabled ● Boolean scalar​

True records only pages matching urlMatchingRules; false records all pages not blocked.

setRecordingSettings.endSessionOnBlockedUrl ● Boolean scalar​

True ends recording when a blocked page is reached; false skips that page and allows the session to continue. Defaults to false for new settings.

setRecordingSettings.urlMatchingRules ● String scalar​

JSON-encoded string. Pages to record when pageTargetingEnabled is true, as {"rules":[...]}. Each rule has u, a full URL, or a pattern using * with "o":"*"; legacy o values r and h are converted on read. Null clears the list. Example: {"rules":[{"u":"https://example.com/pricing"},{"u":"example.com/blog/*","o":"*"}]}

setRecordingSettings.blockedUrlMatchingRules ● String scalar​

JSON-encoded string. Pages never to record, same {"rules":[...]} shape as urlMatchingRules; see endSessionOnBlockedUrl. Null clears the list. Example: {"rules":[{"u":"example.com/account/*","o":"*"}]}

setRecordingSettings.maskElements ● String scalar​

JSON-encoded string. Array of elements to mask in recordings, each with a CSS selector and an optional note. Null clears the list. Example: [{"selector":".account-number","note":"Card digits"}]

setRecordingSettings.samplingType ● SamplingType enum​

AUTO for automatic sampling, RATE for a percentage, or STATIC for a fixed recording count.

setRecordingSettings.samplingValue ● Float scalar​

For RATE, percent of visitors from 0 to 100 (25.5 is 25.5%), truncated to two decimals; for STATIC, target recordings per month, truncated to an integer. Send samplingType in the same call; omit for AUTO.

Type​

RecordingSettings object​

Recording configuration exposed in both the current sampling fields and deprecated legacy sampling fields for backward-compatible clients. Returned within site and sites and by setRecordingSettings.