At Axeptio, we love diversity. It's kind of our motto. So in addition to applying it to our (superb and magnificent... oh come on!) team, we also apply it to our cookies. Guess what, they're multilingual.
So here's what we offer to make your cookies talk:
- Speak cookie, speak!
- Integration via the backoffice
- Technical integration
A. Integration in the Axeptio script
B. Integration via our Google Tag Manager model
1. Speak cookie, speak!
To make your cookies talk, there are two possibilities. The first one, via an integration from the Axeptio backoffice. The second one, a bit more technical, directly in the Axeptio script.
But before that, a first step is necessary. You will need to create as many configurations as there are languages. A configuration in French for France 🇫🇷, a configuration in Spanish for Spain 🇪🇸, a Portuguese configuration for Portugal 🇵🇹... You get the idea?
✅ In each configuration, you can translate all of your texts
2. Integration via the backoffice
In order to quickly integrate the multilingual widget on your site, we have set up a regex system in our backoffice, under the "Integrate on your site" section
⚠️ For the uninitiated, a regex (or regular expression in French 🇫🇷) is a string of characters that describes, according to a specific syntax, a set of possible strings of characters 🤯
Ok great. But what does that actually mean?
For our site, we used this feature. In the example below, it's the configuration for the English version. As you can see, we just had to add en.* after our domain name.
✅ Don't forget to check the RegExp box!
3. Technical integration
A. Integration in the Axeptio script
Several methods are available to load the correct version in any situation !
📞 Hello cookie, this is lang!
This technical integration is also possible via Google Tag Manager.
- Through the browser language:
// Replace the value 000000000000000 with your id
window.axeptioSettings = {
clientId: '000000000000000',
cookiesVersion: {
type: "browser_locale",
cases: {
default: "-en",
"fr-FR": "-fr",
"it-IT": "-it",
}
}
};
(function(d, s) {
var t = d.getElementsByTagName(s)[0], e = d.createElement(s);
e.async = true; e.src = "//static.axept.io/sdk.js";
t.parentNode.insertBefore(e, t);
})(document, "script");
- Through a custom function:
For example, based on the "lang" parameter of the page
// Replace the value 000000000000000 with your id
window.axeptioSettings = {
clientId: '000000000000000',
cookiesVersion: {
type: "custom_function",
config: {
function: () => {
return document.documentElement.lang;
}
},
cases: {
default: "-en",
"fr-FR": "-fr",
"it-IT": "-it",
}
}
};
(function(d, s) {
var t = d.getElementsByTagName(s)[0], e = d.createElement(s);
e.async = true; e.src = "//static.axept.io/sdk.js";
t.parentNode.insertBefore(e, t);
})(document, "script");
The name of the version to specify for each case (in the examples above : "-en", "-fr", "-it") can be found here:
B. Integration via our Google Tag Manager template
In the case of a multilingual site, you can put a variable in the Cookies Version field of your Axeptio tag in order to display the correct banner depending on the language.
Here is an example:
Create a variable that retrieves the site's language. For example, based on the "lang" parameter of the HTML tag:
Create a lookup table, which takes the language variable as input, and the corresponding cookie version as output:
Put this Lookup Table variable in the Cookie Version field of the Axeptio CMP tag:
✅ Congratulations! The language management is now well configured!