Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Passing website language using PegaChatTags

Updated on November 30, 2023

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

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us