How to Change the Default Language of a Cookie Consent Banner

If you’re using Consentise on a multilingual website, it’s important to set the cookie consent banner to display in the correct default language for your visitors. This guide explains how to configure the default language using the data-default-language attribute.

Where to Update the Language Setting

The data-default-language attribute is part of the Consentise script that you embed in the <body> section of your HTML page. It allows you to define the language in which the banner appears by default when the user first visits your site.

Here’s an example of the script:

<script src="https://www.consentise.com/v1.2/consent-min.js" 
data-cookiedomain="www.your-website.com" 
data-privacy-policy-url="https://www.your-website.com/privacy-policy" 
data-preferred-color="#4fa5d3"
data-banner-position="bottom"
data-default-language="en"
defer></script>

To change the default language, simply update the value of the data-default-language attribute.

Example

To display the banner in German by default, update the script like this:

data-default-language="de"

Tips for Multilingual Websites

• The default language should match the main content language of the webpage or domain.
• If you’re using subdomains or subfolders for different languages, you can assign different data-default-language values on each version.
• Consentise also supports automatic language detection based on browser settings, but the default language acts as a fallback when detection fails.

Final Notes

• Always test your banner in incognito/private mode to verify how the language loads for first-time visitors.
• Pair the correct default language with the appropriate privacy policy URL if you’re serving localized privacy content.

Need more help? Contact Consentise support or browse more articles in our Help Center.