Skip to main content
ReDem only uses the last 300 mouse events (MOUSE_MOVEMENT and MOUSE_CLICK together) per BAS data point. Cap client-side tracking at the same limit — storing more only inflates browser session data without improving scoring.
CATI / shared browser sessions: When interviewers run back-to-back interviews in the same browser tab, clear BAS sessionStorage data after each interview is submitted to ReDem (success or error) and again at survey entry. Otherwise mouse and keystroke events from a prior interview can bleed into the next respondent. Do not clear on every question page — only at survey entry and after addRespondent, so multi-page interviews can still accumulate tracking data.
1

Implementing a JavaScript Tracker for User Behavior Data

Copy the typing sample, the mouse movement sample, or both into your survey platform’s frontend. Typing is for open-ended questions. Mouse tracking is especially useful on grid questions. If you track both for the same data point, merge them by timestamp into a single interactionData array when you save.

2

Integrate ReDem API into your workflow

These scripts persist interaction data in the browser until you are ready to call the API.

Typing

Mouse movement

3

Use API response to trigger your next step

When you are making the API call to ReDem use this structure from the session storage and make sure to connect QUESTION_ID during the integration process. For CATI, clear BAS keys at survey entry and again after addRespondent (success or error):