Limiting the Cookie declaration to a specific language with Google Tag Manager

When you operate a multilingual website and would like to have the cookie declaration displayed in the same language as your website you can use the data-culture attribute.

In this example, the language is set to  Spanish:

var contentPlaceholder = document.getElementById("bodycontent");

var cookieDeclarationScript = document.createElement("script");

cookieDeclarationScript.type = "text/javascript";

cookieDeclarationScript.id = "CookiePolicy";

cookieDeclarationScript.src = "https://consent.cookiebot.com/00000000-0000-0000-0000-000000000000/cd.js";

cookieDeclarationScript.setAttribute("data-culture", "es");

contentPlaceholder.appendChild(cookieDeclarationScript);

</script>