Passing website language using PegaChatTags
Improve the global customer experience and maintain a consistent and professional appearance of your Web Messaging channels by implementing a PegaChatTags script. This script passes your website's preferred language to determine the language of the Web Messaging widget when a customer accesses it.
The Web Messaging widget follows a specific sequence and conditional logic to determine the language, continuing until a value is found. For more information, see Sequence for determining language in Web Messaging.
Install either of the following scripts in your webpage from which the Web Messaging widget is launched:
<script language="javascript">
var PegaChatTags = {
"lang": "{ Placeholder for Customer Info }"
}
</script>
For example, in the above script, you can use the lang parameter to select the Spanish language as the preferred language for this option, as shown in the definition below:
"lang": "es"
Alternatively, you can also use the following script that uses the Document Object Model (DOM) to pass the browser language:
<script language="javascript">
var PegaChatTags = {lang: document.documentElement.lang}
</script>
Previous topic Sequence for determining language in Web Messaging Next topic Embedding the Web Messaging widget in a native Pega Platform application