Session Recording API
Pingtree’s Session Recording feature captures user interactions on your landing pages and form flows in real time. Recordings can be replayed later for quality assurance, compliance auditing, conversion optimization, and dispute resolution.What is Session Recording?
Session Recording is powered by rrweb, an open-source library that captures a full, pixel-accurate replay of everything a user does on a page — mouse movements, clicks, scrolling, form input, and more. Each recording is tied to a specific lead transaction so you can correlate a replay with the exact lead record. Recordings are streamed to the Pingtree backend every 3 seconds and stored server-side, then uploaded to S3 for long-term retention and replay access.How It Works
- When a user lands on a campaign page where Session Recording is enabled, the browser loads the rrweb recording script.
- The recorder calls
POST /recording/initializeto create a new session and receive a uniquesessionId. - The
sessionIdis stored insessionStoragewith a 10-minute expiry, so the same session is reused across page navigations within the same tab. - Recorded events are batched and sent to
POST /recording/store_eventsevery 3 seconds, encoded as Base64. - When the user completes or exits the form flow, a final flush sends any remaining events.
- The backend merges the incoming events with any previously stored events for the same session, building a complete replay file.
Enabling Session Recording
Session Recording is configured at the Campaign level. Configuration Path:Campaign > Single View > Integrations Tab > Session Recording
Prerequisites
- Your advertiser account must have a sufficient wallet balance. The system checks your balance before initializing each new recording.
- A per-recording cost (
sessionRecordingCost) is deducted from your balance the first time a recording is initialized for a given transaction. Subsequent event flushes for the same transaction are free.
Configuration Options
| Option | Description |
|---|---|
| Enable Session Recording | Toggle to activate session recording for this campaign. When enabled, the rrweb script is automatically injected into your campaign’s landing pages and form flows. |
| API Key | Not required — session recording uses Pingtree’s internal infrastructure. No third-party API key is needed. |
Note: The recording script is only injected when billing is enabled and your account has a positive balance. If your balance is zero or your account is blocked, the script is silently skipped and no recording takes place.
API Endpoints
These endpoints are used internally by the Pingtree recording script. You do not need to call them directly.POST /recording/initialize
Initializes a new recording session.
Request body:
| Field | Type | Description |
|---|---|---|
url | string | The current page URL being recorded. |
cid | string | The campaign unique ID. |
transactionId | string | The lead transaction ID. |
POST /recording/store_events
Stores a batch of recorded events for an active session.
Request body:
| Field | Type | Description |
|---|---|---|
sessionId | string | The session ID returned by /initialize. |
encodedString | string | Base64-encoded JSON array of rrweb event objects. |
Recorded Data
Each session recording stores the following metadata alongside the event replay:| Field | Description |
|---|---|
recordingId | Unique session identifier (UUID). |
transactionId | The lead transaction this recording belongs to. |
cid | The campaign ID. |
url | The page URL where recording started. |
userIp | The visitor’s IP address. |
browser | Browser and user agent details. |
hasRecording | true once at least one event batch has been stored. |
isUploaded | true once the recording has been uploaded to S3 for long-term storage. |
Usage and Billing
- A cost is deducted from your advertiser balance once per unique transaction (i.e., per lead), not per event batch.
- Campaign-level counters (
apiUsageCount.session) track total recordings, monthly recordings, and associated costs. - You can monitor recording usage in your campaign reporting dashboard.
Use Cases
- Compliance Auditing: Replay exactly what a user saw and did when submitting a lead, useful for TCPA and consent-related disputes.
- Conversion Optimization: Identify where users drop off in your form flows and improve the experience.
- Quality Assurance: Spot bot-like behavior or suspicious form interactions in your lead data.
- Dispute Resolution: Provide a timestamped, verifiable replay of a user session to resolve advertiser or publisher disputes.
Tip: Combine Session Recording with TrustedForm or eConsent to build a robust compliance and consent documentation stack for each lead.