At Axeptio, we love diversity. You can say it's our leitmotif. Not only do we love it in our (gorgeous and wonderful... oh stop, we're blushing!) team, but it is also a key ingredient (so to speak) in our cookies. And guess what... they're multilingual.
So, here's what we suggest to get your cookies talking:
1. Speak, cookie, speak!
There are two possible ways to make your cookies speak. The first involves an integration from Axeptio's back office. The second—and slightly more technical—option uses the [lang] attribute directly in your site's code.
But before that, there is a step that needs to happen first. You need to create as many configurations as there are languages. A French configuration for France 🇫🇷, a Spanish configuration for Spain 🇪🇸, a Portuguese configuration for Portugal 🇵🇹, and so on. Got it?
✅ In each configuration, you can translate all of your text.
2. Back-office integration
To quickly integrate the multilingual widget into your website, we've added support for regex in our back office.
⚠️ For the uninitiated, a regex (or regular expression) is a string of characters that uses a precise syntax to describe a set of possible strings. 🤯
Okay, cool. But hold on, what does that mean?
We use this feature on our website. The example below shows the configuration for the English version. As you can see, all we had to do is add en.* after our domain name.
✅ Always remember to check the RegExp box!
3. Technical integration
Here, all you need to do is call the right cookiesVersion based on the [lang] attribute on your site. 📞 Hello, cookie? It's me, lang!
This technical integration can also be done through Google Tag Manager.
// Replace the value 000000000000000 with your id
window.axeptioSettings = {
clientId: '000000000000000',
};
if (document.documentElement.lang === 'en-US'){
window.axeptioSettings.cookiesVersion = 'Prod_en';
}
if (document.documentElement.lang === 'fr-FR'){
window.axeptioSettings.cookiesVersion = 'Prod_fr';
}
if (document.documentElement.lang === 'es-ES'){
window.axeptioSettings.cookiesVersion = 'Prod_es';
}
(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");
✅ You did it! Language management is now set up!