Skip to main content
All CollectionsWebsite surveysLaunching survey on your website or in-product
Disable Sensitive User Data Persistence for Website or in-product surveys

Disable Sensitive User Data Persistence for Website or in-product surveys

Store data in Session Storage instead of Local Storage

Agnieszka avatar
Written by Agnieszka
Updated over a week ago

The Disable Sensitive Data Persistence feature allows you to disable storing persistent sensitive data between browser sessions. By enabling this feature, all user attributes, provided answers, and triggered events will be kept only in the browser's Session Storage and removed once the session ends.

In this article, you'll learn how to set it up and what benefits it can bring you.

This feature is available on subscription plans which include the JavaScript API feature.

If you are interested in adding it to your plan, contact sales@survicate.com or reach out to our team from the live chat 👉

How does it work?

Normally, survey-related data is stored in a browser’s Local Storage, meaning it persists between sessions. If a respondent closes the browser or restarts the computer, the data remains and is still accessible upon reopening the browser.

However, once you enable the Disable Sensitive Data Persistence feature, all previously stored data in Local Storage will be cleared, and all subsequent data will be stored exclusively in Session Storage. That means the data is only kept as long as the current tab or browser session is active. As soon as the browser is closed (or the tab is closed), the stored data is removed.

This feature lets you ensure privacy by preventing long-term storage of sensitive information.

What changes for respondents?

  1. Previously stored respondent attributes will be removed

    As soon as the feature is enabled, any user attributes or responses that existed in Local Storage are erased on the respondents' side.

  2. Survey progress resets

    If a user is in the middle of answering a survey and reopens it in another tab, or closes and reopens their browser, they will start the survey from the beginning.

  3. Survey events re-triggered

    If your survey is event-triggered and set to be answered only once per user, with this feature enabled, visiting the same site in a new tab will trigger the survey again because the user's prior interaction isn’t stored long-term.

Enabling the feature

Step 1. Enable the feature in your tracking code

In your main script, add the disableSensitiveDataPersistence property to your Survicate tracking code:

(function(opts) {
opts.disableSensitiveDataPersistence = true;
})(window._sva = window._sva || {});

Step 2. Add Survicate's main script

Include the Survicate script right after setting the disableSensitiveDataPersistence option:

<script type="text/javascript">
(function(opts) {
opts.disableSensitiveDataPersistence = true;
})(window._sva = window._sva || {});

(function(w) {
var c = document.createElement("script");
c.src = "https://survey.survicate.com/workspaces/{{YOUR WORKSPACE KEY HERE}}/web_surveys.js";
c.async = true;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(c, s);
})(window);
</script>

❗️Important!

  • Enabling this feature clears any existing data stored in Local Storage.

  • All in-progress surveys in the same browser session will be reset, and respondents will start over on reload or in new tabs.

  • Event-based surveys may re-trigger since the respondent’s prior session data is removed.

Using NPM packages

If you’re using our NPM packages, you can achieve the same result by including the corresponding option in your Survicate initialization settings. For more details, please visit our Developers docs.

📞 If you have any questions or need further assistance, feel free to reach out to our team via chat or email on support@survicate.com.

Did this answer your question?