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, 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, and it’s never sent to SurveyRock. It’s how the widget decides whether to ask a visitor, and avoids asking the same visitor again.
By default the widget stores it 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, and remembers what it needs for the current page view only;
- call
SurveyRock('consent', true)when the visitor accepts, and it starts storing its record; - call
SurveyRock('consent', false)when they decline or withdraw, and it deletes it.
SurveyRock('reset') also deletes the record, for example when a user signs out.
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. Our Cookie Policy describes the item 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.
Your site decides whether the widget needs a visitor’s consent where they are; the consent mode is there so it can wait.