Skip to content

The website widget and cookie consent

The widget stores one item in the visitor’s browser, surveyrock_widget in local storage. It holds, per widget, when the visitor was last shown it, closed it or answered it, when a prompt they minimized was last on screen (so its button comes back on the next page of the same visit), and a number used for sampling. If your widgets use visitor history, it also holds what those rules need: a count with first and last dates for each event they name, page views and visits, when the visitor last viewed a page, and the visit’s referring site and UTM values. We put no identifier and no answer in it. It’s how the widget decides whether to ask a visitor, and avoids asking the same visitor again.

What the widget tells SurveyRock:

  • For every visitor: a count when an edge tab is shown and when a survey is closed without an answer, for the widget’s numbers. Nothing about the visitor goes with it.
  • For a visitor your site signs (Growth and up): when each widget was shown, closed or answered, kept against a coded form of the user ID or email, so they aren’t asked again on another device. See Signed-in visitors, on every device.

Nothing else in the item leaves the browser.

By default the widget stores the item straight away. If your site waits for consent before storing anything, choose Store nothing until your site calls SurveyRock('consent', true) on the Website, or add data-consent="required" to the snippet’s tag. Then:

  • the widget still shows. Until the visitor consents, it remembers only when each widget was shown, closed or answered, in the browser tab’s session storage, so a survey the visitor closed doesn’t come back on the next page. The browser deletes it when the tab closes;
  • call SurveyRock('consent', true) when the visitor accepts, and it starts storing its record in local storage;
  • call SurveyRock('consent', false) when they decline or withdraw, and it deletes that record and goes back to remembering in the tab’s session storage.

If the browser blocks local storage, the widget uses the tab’s session storage in the same way.

When a user signs out of your site, call SurveyRock('identify', null). The widget stops treating the visitor as that person (the next answer carries no identity), and the browser keeps its own record.

SurveyRock('reset') deletes the browser’s record and forgets the identity too. Use it to start the widget again from nothing.

The survey inside the card keeps its own cookies so a visitor can come back to a half-finished answer. In a frame on your site those cookies are partitioned to your site: no other site can read them. List the widget in your cookie banner as functional storage from SurveyRock: surveyrock_widget in local storage, and in session storage while consent is pending. Our Cookie Policy describes it for your visitors.

If you use visitor history or source rules, the item records what visitors did on your site and where they came from. For visitors outside the US we recommend the consent mode above, and you may list it with your analytics or marketing storage if that is how your banner groups it. UTM values are stored as they appear in the link, so don’t put a person’s email address or ID in utm_source, utm_medium or utm_campaign on links to these pages.

Remembering signed-in visitors on SurveyRock doesn’t store anything on the visitor’s device, so the consent mode doesn’t change it. Whether your visitors need to be told about it, or asked, is your site’s decision; if you’d rather not use it, clear Remember signed-in visitors across devices on the Website.

Your site decides whether the widget needs a visitor’s consent where they are; the consent mode is there so it can wait.