TrustedFormStopRecording Function

Christopher Williams
Christopher Williams

Feature Snapshot

Summary:
TrustedFormStopRecordFunction allows developers to manually stop a TrustedForm Certify Web SDK recording session after it has started.

Key Benefits:

  • Provides control over when TrustedForm session recording stops.
  • Supports modern web architectures such as Single Page Applications (SPA) where page unload events may not occur.
  • Enables developers to limit recording to only the relevant portion of a user session.

Typical Use Cases:

  • Stopping recording after a form submission in a Single Page Application where the page does not reload.
  • Ending recording once required user actions are completed.
  • Limiting the captured session replay to a specific part of a user interaction flow.

How the TrustedFormStopRecordFunciton works

TrustedForm Certify typically loads, scans the page, and begins recording end-user interactions automatically. Recording continues until the page unloads, which commonly happens when a form is submitted and the user is redirected to a Thank You page.

In modern web applications such as Single Page Applications (SPA), form submissions may not trigger a page unload. To support this scenario, the TrustedForm script exposes a global function that allows developers to manually stop recording.

Once the TrustedForm script is loaded and recording, the following global function can be invoked:

trustedFormStopRecording()

Calling this function stops the TrustedForm recording session.

Important:
Once trustedFormStopRecording() is called, the recording session cannot be restarted.


Step-by-Step Instructions

  1. Ensure the TrustedForm Certify Web SDK script is loaded on the page.
  2. Allow the TrustedForm script to initialize and begin recording the end-user session.
  3. At the appropriate point in your application flow, invoke the global function:
trustedFormStopRecording()
  1. The TrustedForm recording session will stop immediately.

Expected Result:
TrustedForm stops recording user interactions for the current page session, and no additional events are captured.

📷 Screenshot Placeholder: Example showing TrustedForm recording stopping after function invocation.


Validation & Monitoring (optional)

  • Test the Setup: Trigger the trustedFormStopRecording() function during a test session and confirm that additional user interactions are not recorded afterward.
  • Where to Monitor: Verify that the TrustedForm Certificate contains only the portion of the session recorded before the stop function was called.

Best Practices

  • Call trustedFormStopRecording() only after all necessary user interactions have been captured.
  • In Single Page Applications, coordinate the stop event with form submission or completion events.
  • Ensure the TrustedForm script has fully initialized before invoking the stop function.
  • Remember that recording cannot be restarted once it has been stopped.

Troubleshooting

Symptom / Error Likely Cause Resolution
Recording continues after expected stop point trustedFormStopRecording() was not invoked Ensure the function is executed at the correct event in your application flow
Recording stops too early Stop function triggered prematurely Adjust the event trigger to occur after required interactions
Recording cannot be restarted Stop function was called This is expected behavior; once stopped, recording cannot resume

Frequently Asked Questions (FAQ)

Q: Can TrustedForm recording be restarted after calling trustedFormStopRecording()?
A: No. Once the stop recording function is called, the recording session cannot be restarted. However, a new recording session can be started by using ‘trustedFormNext()’

Q: Why would I need to manually stop TrustedForm recording?
A: Manual stopping is useful in Single Page Applications where a form submission does not unload the page, meaning the recording would otherwise continue indefinitely.

Q: When should I trigger the stop recording function?
A: Typically after a form submission or once the relevant user interaction portion of the session has completed.

Q: Can I also control when TrustedForm’s recording starts?
A: TrustedForm beings recording immediately once the script is initialized. Due to this, there isn’t a designated function to start recording but By wrapping the TrustedForm Certify javascript snippet in a function, you make it available to be called by a specific action later.
For example:

function beginTrustedFormRecording() {
  // Insert the TrustedForm Certify javascript snippet here 
  // Get it at https://activeprospect.com/trustedform/certify
}

Using this strategy you could simply trigger beginTrustedFormRecording() to control when the recording starts.


Glossary

Term Definition
TrustedForm Certify Web SDK A JavaScript library that records user interactions on a webpage and generates a TrustedForm Certificate.
Single Page Application (SPA) A web application that dynamically updates content without fully reloading the page.
Session Recording Capturing user interactions with a webpage during a browsing session.
Global Function A JavaScript function accessible from anywhere in the page once the script defining it is loaded.

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.