Didomi - Developers documentation
  • Introduction
  • SDKs
    • Introduction
    • Web SDK
      • Getting started
      • Tags and vendors management
        • Tags management
          • Events & Variables
            • Deprecated
            • Custom events
          • Tag managers
            • Adobe Launch/DTM
            • Eulerian
            • Google Tag Manager
              • Configure the Didomi / GTM integration
              • Didomi's GTM template
            • Tealium
            • Other tag managers
        • Custom Didomi <script> tags
        • Third-party integrations
          • Google Ad Manager / AdSense
            • GDPR via Non-Personalized Ads
              • Share consent and load/refresh ads
              • Share consent without loading or refreshing ads
            • US states laws
          • Google Consent Mode V2
          • Kameleoon
          • Piano Analytics (AT Internet)
          • Prebid
            • GDPR via IAB TCF
            • US states laws
          • Salesforce DMP (Krux)
        • IAB frameworks
        • Programmatic API
      • Configuration
        • Bots (SEO & Performance tools)
        • Configuration by URL
        • Cookies and storage
        • Custom domains for events
        • Notice
          • Behavior
          • Interactions
          • Look and feel
        • Preferences
        • Theme
      • AB tests
      • Custom domain
        • Domain delegation
        • Reverse proxy
      • Share consents between domains
      • Share consents across devices
      • Pass user choices in query string
      • Serve Didomi assets from your domain
      • Reference
        • API
          • Deprecated
        • Events
      • Performance
      • Versions
    • Mobile and TV SDKs
      • Android and Android TV
        • Setup
        • Logging
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • iOS and tvOS
        • Setup
        • Logging
        • App Tracking Transparency (iOS 14.5+)
        • Reference
          • API
            • Deprecated
          • Events
        • Versions
      • Unity
        • Setup
        • Reference
        • Versions
        • Troubleshooting
      • React Native
        • Setup
        • Reference
          • Deprecated
        • Versions
      • Flutter
        • Setup
        • Reference
        • Versions
      • Consent notice
        • Getting started
        • Customize the notice
        • Customize the preferences popup
        • Customize the theme & UI
        • Load notice by ID
      • Third-party SDKs
      • Share consents across devices
      • Share consent with WebViews
      • Google Consent Mode v2
      • FAQ
    • AMP SDK
      • Blocking Behaviors
        • Load immediately on page load
        • Load only after consent (positive or negative)
        • Load only after positive consent
      • Consent status for vendors
    • Help & Support
  • API
    • Introduction
      • Authentication
      • Errors
      • Pagination
      • Filters
      • Caching
      • Rate limiting
      • Quotas
      • Translations
    • Data Manager
      • Regulations
      • Configuration Tree
      • Purposes
        • Purposes & Vendors Numerical IDs
      • Preferences Library
      • User Rights
    • Widgets
      • Consent notices
        • Notices
        • Configurations
        • Multi-Regulation Configurations
          • Migration of Existing Notices and API Updates
        • Deployments
        • Tutorials
          • Create and publish a consent notice
          • Create and publish a multi-regulation consent notice
      • Privacy widgets
        • Create a widget
        • Retrieve widgets
        • Edit a widget
          • Content & Design
            • Themes & Shapes
            • Components
              • auth
              • dsar_form
              • footer
              • header
              • preference
              • preference_value
              • save
              • section
              • sections
            • Options
          • Purposes & preferences
          • Settings
        • Deploy a Widget
          • Use your own subdomain
          • Use your own domain
          • Implement an embeddable widget on your website
        • Authentication
          • Manage authentication providers
          • Authenticate your end-user
        • Archive a widget
        • Headless widgets
          • Public Methods
          • Custom elements
          • Custom events
          • Event listeners
        • Tutorial
          • Launch a Preference Center from a mobile app
    • Compliance Reports
      • Properties
      • Reports
      • CSV format reference
      • Websites
    • Consents and Preferences
      • Events
        • Generate IAB TCF consent string
      • Links
      • Proofs
      • Tokens
      • Secrets
      • Users
      • Tutorial
        • Collect and operate data
    • Privacy Requests
      • Requests
      • Notes
      • Links
      • Emails
  • Integrations
    • Introduction
      • Quotas
    • Generic integrations
      • Batch export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
        • Exported data
          • Notices consents
        • Logs
      • Webhooks
      • Batch import
      • Analytics export
        • Destinations
          • AWS S3 Bucket (owned by Didomi)
          • GCP Storage Bucket
    • Third-party apps
      • CMP integrations
        • Didomi-mParticle integration for your CMP
        • Deploy Didomi’s SDK for your Adobe Commerce website
      • Preference Management Platform integrations
        • Actito
        • Adobe Campaign Classic
        • Adobe Experience Cloud
        • Adobe Marketo Engage
        • Adobe Source Connector
        • Braze
        • Dotdigital
        • Hubspot
        • Mailchimp
        • Microsoft Dynamics 365
        • Salesforce Marketing Cloud
        • Salesforce Sales & Service Cloud
        • Selligent
        • Brevo (ex Sendinblue)
    • Tutorials
      • Configure a HTTP webhook
      • Configure a batch export
      • Configure an analytics export
    • Emailing
      • Configurations
        • Actito Email
        • Actito SMS
        • Adobe Campaign Classic
        • Adobe Campaign Standard
      • Emails
        • Templates
        • Manage your templates
Powered by GitBook
On this page
  • Store consent on a different domain (subdomain)
  • Cookie name
  • Enabling Collection of Consent for Different Pages
  • Storage sources for user information
  1. SDKs
  2. Web SDK
  3. Configuration

Cookies and storage

By default, the Didomi CMP uses first-party cookies to store consent information. Consent is stored in the base domain and shared across all the subdomains of the base domain where the SDK is deployed.

Example: If you install Didomi on www.domain.com, consents will be stored in a cookie on .domain.com and all sub-domains of domain.com will have access to the same consent information.

Store consent on a different domain (subdomain)

If you want to store the first-party cookie on a specific sub-domain, you can add this option into the configuration.

Consents will be shared only to pages with this specific sub-domain.

window.didomiConfig = {
  cookies: {
    local: {
      customDomain: 'privacy.your-domain.com'
    }
  }
};

Cookie name

The Didomi SDK uses up to three cookies and local storage items for storing user consent:

  • didomi_token for vendors and purposes in the token format (JSON format)

  • didomi_dcs for vendors and purposes stored in the Didomi Consent String format (binary encoded)

  • euconsent-v2 for IAB TCF vendors and purposes (only for the GDPR regulation)

The name of the didomi_token , didomi_dcs and euconsent-v2 cookies can be modified if you want to use a different name by setting the cookies property:

window.didomiConfig = {
  cookies: {
    didomiTokenCookieName: 'custom_cookie_name', // didomi_token custom name
    iabCookieName: 'custom_iab_cookie_name', // euconsent-v2 custom name
    didomiConsentStringCookieName: 'custom_dcs_cookie_name' // didomi_dcs custom name
  }
};

Keep in mind that modifying the cookie name on a website that already had the Didomi SDK installed will re-collect consent. We recommend using a short cookie name.

Enabling Collection of Consent for Different Pages

There may be a case where some pages on your website(s) do not belong to the same legal entity, but you want to collect consent on different pages, for example, displaying multiple notices on the website, with different vendors configuration, and local regulations, and save them "locally" and not at the domain level.

If you would like to separate consent between different sub-domains or pages inside the domain you can use custom cookie names to store the user consent status in different cookies / storage items.

In this case, you must define a different name for both didomiTokenCookieName and iabCookieName by setting the didomiConfig.cookies property inside the given page as it is described in the previous sections and have the Web SDK loaded for this page.

Storage sources for user information

By default, the Web SDK stores user information and choices in both cookies and local storage. You can configure where user information and choices should be stored and use only cookies or local storage if you want to.

Set cookies.storageSources.cookies to false to disable storing data in cookies. Similarly, set cookies.storageSources.localStorage to false to disable storing data in local storage.

For instance, to configure the Web SDK to use local storage only:

window.didomiConfig = {
  cookies: {
    storageSources: {
      cookies: false,
      localStorage: true
    }
  }
};
PreviousConfiguration by URLNextCustom domains for events

Last updated 11 months ago

Please have a look at the to see how it works.

Didomi Sandbox for Collecting Consent on Different Pages