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"; = "CookiePolicy";

cookieDeclarationScript.src = "";

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