Change the widget or property based on page language
tawk.to lets you create a widget or a property for each language on your website.
To use each model, you’ll need to do the following:
1. Create a widget for each language
Related: Changing your widget's language
2. Find your widget and property IDs.
Learn more here: Where can I find the property and widget IDs?
This solution may vary depending on how multi-language options are set up on your website. The code snippets below are for a website with a URL in the following format:
To set a widget to appear based on the language of a page, use the following code. Then, to override and change the widget that appears, modify the getChatId function to return a specific chat id for each language.
Here’s a way to change the property based on page language by modifying the `getChatId` function again and updating the return values for each language.
Changing the property connects your customers with the agents, statistics, shortcuts, and knowledge base of the new property.
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.