Placing a Chat Widget via Google Tag Manager for multilingual websites
While your Pulse chatbot automatically responds in the language the question is asked, the chat widget is set in a single language. If your website is multilingual and allows users to select the language through, for example, a menu, it can be beneficial to create a separate chat widget for each language. The steps to display the correct chat widget on the right pages are described below.
- Log in to Google Tag Manager and go to the account you want to install the tag on.
- From the left menu, choose Tags and click the New button in the top right corner to add a new tag.
- Give the tag a recognizable name, such as 'Chat widget - Website NL.'
- Choose 'Custom HTML' as the tag type. Place the code snippet of the chat widget under the HTML section. Check 'Support document.write.'
-
Add a trigger. Here, you'll configure where the code (and thus the chat widget) should be displayed on the website. Select the trigger type 'Page view.' Choose 'Some page views.' Configure the triggers as follows:
- Column 1: Page URL
- Column 2: contains
- Column 3: /nl/ (or the relevant language code for your website)
-
For websites where the widget should only appear on a specific domain, add an extra trigger:
- Column 1: Page Hostname
- Column 2: equals
- Column 3: your domain (for us, this might be watermelon.ai, ensuring the chat widget is not displayed on other domains).
- Save the new tag. Now, the chat widget is visible as you've just configured!
Repeat these steps for each chat widget, per language. This is an effective way to localize your website and display the correct language chat widget on each page of your website.
Updated about 2 months ago