Change the widget based on the visitor’s language

Setting up widgets in multiple languages allows you to personalize the customer experience for each visitor on your website. JavaScript allows you to automatically load the widget based on the language set on the visitor’s device.


Here’s what you need to do to get started:


1. Create a widget for each language


Related: Changing your widget's language


2. Find the property and widget IDs


Learn more here: Where can I find the property and widget IDs?


The code snippet below automatically detects the visitor’s language set on their device and displays the appropriate widget based on the criteria set.

Learn more about adding multiple widgets to a website in this step-by-step guide: How to add multiple widgets to a website with JavaScript


If you need additional assistance setting up multiple widgets on your site, visit our Developer Platform or reach out in the chat. We are here to help 24x7.

Was this article helpful?

14 out of 16 liked this article

Still need help? Message Us