This article explains how to configure the dark mode of the ViaDesk live chat widget so that it adapts to sites with a light or dark theme.
Prerequisite: The widget must already be installed on your site (code pasted on the web or via Google Tag Manager). If you haven't installed it yet, first create the Website inbox in ViaDesk.
How it works
Many sites allow the visitor to use a light or dark theme (or follow the operating system preference). The ViaDesk widget can align with this using the darkMode parameter in the script settings object you installed.
| Value | Behavior |
|---|---|
light |
Light mode only. This is the default value. |
auto |
Enables dark mode according to the visitor's operating system / device preference. |
Current limitation: The fixed dark value (always forcing dark) is not available yet. Use auto if you want it to match the device theme.
How to enable it
- Open the widget code you installed on your site (or the HTML tag in Google Tag Manager).
- Inside the settings object that already comes with that script, add the line
darkMode: "auto". - Save and publish the changes.
- Test in the browser with the system theme in light and dark (or on another device).
Line to add (inside the existing settings object):
darkMode: "auto",
Tip: Do not duplicate the settings block if one already exists in the ViaDesk script: just add darkMode there. Do not rename the configuration object that comes in the code; the widget needs it as is.
If you installed the widget with GTM
- Go to Google Tag Manager.
- Edit the ViaDesk custom HTML tag.
- Include
darkMode: "auto"in the script settings object. - Submit and Publish a new version of the container.
Frequently asked questions
- It does not change to dark: verify that the value is exactly
"auto"(in quotes) and that the published page has the updated code (Ctrl+F5). - The change is not visible in GTM: the version may not be published, only saved.
- I want to always force dark: for now it is not supported; use
autoor leavelight. - It broke the widget when editing: restore the original script from ViaDesk (Settings → Inboxes → Configuration → Copy) and add only
darkModeagain.
If you need help locating the code or publishing the change on your site / GTM, open a ticket from the client portal, ask via the online chat with Aura on the site, or write to us on WhatsApp at +54 9 11 7826-8881.
