Purpose: Disable the Freestar Recovered modal for authenticated users while continuing to send user data to Freestar pipelines.
Since each publisher uses a unique authentication system, you must signal a user’s login status before the Freestar Recovered script executes. Set one of the supported flags to true to disable the modal for logged-in users.
Prerequisites
Implementing site logic that determines when a user is authenticated.
Ability to set a global variable, a sessionStorage key, or a first-party cookie before the FSR script runs.
Supported script version:
1.5.0
Note: disabling the modal does not stop data collection. Freestar will continue to receive event data; only the user-facing modal is suppressed.
Configuration Options
Only one method is required. Set it to true before the FSR script loads; the modal will not render for that session.
Option A — Global window variable
window.disable_fsr = true;
Best when you can directly control the page’s bootstrap sequence (e.g., in your layout or tag manager with an early firing rule).
Option B — Session storage
sessionStorage.setItem('disable_fsr', 'true');
Good for per-session control and when you want the modal to reappear in a fresh tab or after the browser is closed.
Option C — Cookie
// Path-wide cookie so all routes inherit the flag document.cookie = "disable_fsr=true; path=/";
Useful when multiple subpaths or microfrontends need consistent suppression without coordinating storage APIs.
When using cookies, consider expiration and domain scope consistent with your privacy policy.
Activation & Deactivation
To disable FSR: Set your chosen variable to
truebefore the FSR script loads.To re-enable FSR: When a user logs out, set the variable to
false(or remove it) before the next execution of the FSR code.
Troubleshooting
Load order: The disable flag must be set BEFORE the FSR script executes.
Scope: Cookies should include
path=/for site-wide effect; sessionStorage is tab-scoped; window variables are page-context only.Race conditions: For SPAs, ensure auth state is available synchronously on first paint or set a pre-script that checks a server-rendered hint (e.g., a cookie) before hydration.
Script version: Feature requires Freestar Recovered
v1.5.0or later.