Choose the Correct Data Type
Tags and measurements cannot affect whether recording starts. Use context for policy
targeting.
Add Context
Pass context when you initialize the SDK:
Include the field selected as the targeting key in the policy for this client. For a
conditional rule, this is the Of field. If the policy uses user_id, pass a stable
user_id value for the same user in each session.
Keep this context aligned with the context used by the Confidence SDK for flags.
Use tag() after recording starts:
Tags with the same key accumulate values. A tag without a value acts as a marker.
Duplicate tag values appear only once.
The SDK does not queue tags or measurements before recording starts. A call
made while recorder.isRecording is false does not reach the recording.
Add Measurements
Use measure() for numeric application data:
Measurements with the same key add to one total. A call without a value adds 1.
Measurement values must be finite numbers.
Names and Limits
The SDK drops invalid keys or values. Add a debug logger
to see validation messages. Additional keys or values that exceed the per-recording
limits do not appear in the recording.
Find Custom Data in Confidence
The Recordings list supports tag-key and tag-value filters. A recording’s Insights
view shows custom measurements as metrics. The Signals filter contains only the
built-in recording metrics.
Protect Sensitive Data
The SDK sends all context, tag, and measurement data to Confidence. Do not include
direct personal identifiers, access tokens, or secrets. Use a pseudonymous identifier
only if your organization’s privacy and data-handling requirements allow it. See
Privacy and data masking.