DSAR widget
The DSAR widget is an embeddable form that allows visitors on your website to submit data subject access requests. You can add it to any page — typically a privacy policy page, a dedicated data rights page, or a contact page.
For an overview of the DSAR feature, see Data subject access requests.
Getting the widget code
To get your widget embed code:
- Log in to the CookieHub dashboard.
- Navigate to the DSAR section.
- Click the Get Widget button.
- Copy the provided code snippet.
The widget code includes your account key and domain key, which are used to associate submissions with your account.
Installation
Paste the following code into the HTML of the page where you want the DSAR form to appear:
<div id="cookiehub-dsar-container"></div>
<script
src="https://dash.cookiehub.com/dsar/widget.js"
data-account-key="ak_xxxxxxxx"
data-domain-key="dk_yyyyyyyy"
data-target="#cookiehub-dsar-container"
data-lang="en"
async></script>Replace ak_xxxxxxxx and dk_yyyyyyyy with the actual keys from your widget code in the dashboard.
The data-target attribute specifies the CSS selector of the container element where the widget will be rendered. You can change the container’s id as long as the data-target value matches.
Style isolation
The widget renders inside a Shadow DOM, which keeps the widget’s styles fully isolated from the rest of your page. This means:
- Your site’s CSS will not accidentally break the form’s layout.
- The widget’s CSS will not leak out and affect any other elements on your page.
The Shadow DOM is open, so you can still inspect the widget in your browser’s developer tools.
Theming
You can customize the widget’s appearance by setting CSS custom properties on the host element (the container <div>). The following properties are supported:
| Property | Purpose |
|---|---|
--dsar-primary-color | Buttons and focus rings |
--dsar-button-text | Button text color |
--dsar-bg-color | Widget background |
--dsar-border-color | General border color |
--dsar-input-border | Input field border color |
--dsar-border-radius | Corner radius for the widget container |
--dsar-input-radius | Corner radius for input fields |
Example:
<div
id="cookiehub-dsar-container"
style="
--dsar-primary-color: #2b6cb0;
--dsar-button-text: #ffffff;
--dsar-border-radius: 12px;
"></div>For more advanced customization, key elements inside the widget expose part attributes (such as form, input, and submit-button) that you can target with the CSS ::part() pseudo-element from outside the shadow root.
Language
The data-lang attribute is optional. If omitted, the widget detects the language in this order:
- The
data-langattribute on the script tag (BCP-47 format, e.g.,en,pt-br) - The
lang(orxml:lang) attribute on the page’s<html>element - Falls back to English
Language values are normalized automatically — for example, pt_BR is treated the same as pt-br.
The widget ships with 50+ locales, including English (and US English), German, French, Spanish, Portuguese (Portugal and Brazil), Chinese (Simplified and Traditional), Japanese, Korean, Arabic, Hebrew, Hindi, Tamil, Telugu, Bengali, Thai, Vietnamese, Indonesian, Malay, Turkish, Icelandic, Faroese, Welsh, Basque, and most other European languages.
The detected locale is also stored with each request, so all subsequent emails (verification, status updates, completion) are sent in the same language the data subject used when submitting.
Placement
The DSAR widget can be placed on any page of your website. Common placements include:
- Privacy policy page — Place the widget at the end of your privacy policy so visitors can easily submit requests after reading about their rights.
- Dedicated data rights page — Create a page specifically for data subject requests (e.g.,
/privacy-requestsor/data-rights). - Contact page — Add the widget alongside your other contact methods.
Ensure the page containing the widget is easily accessible from your main navigation or footer, so data subjects can find it without difficulty. Many privacy regulations require that you provide a clear and accessible way for individuals to exercise their data rights.
Next steps
Once the widget is installed, you can:
- Configure DSAR systems to set up the services where you store personal data
- Manage incoming requests through the DSAR portal
- Adjust DSAR settings for file retention, upload limits, and more