Skip to main content

Advanced: chat box position via the JavaScript API

Control the chat box position in code, including different positions for desktop and mobile.

Written by Michal Jindra

Developers can fine-tune where the chat box appears by adding a few configuration options to your Smartsupp installation code. This guide shows how to move the chat box to the left, shift it away from its default position, use a different position on mobile, or hide it on mobile.

Advanced: position in the installation code

🟡 Note: You'll need developer access to your website's code. Moving the chat box to the left side requires the Solo plan or higher.

Add the options to the configuration part of your installation code: after the line with _smartsupp.key and before the loader (the part that starts with window.smartsupp||). The chat box reads them when it loads, so they must be in place before the loader runs.

Move the chat box to the left side:

<script>
var _smartsupp = _smartsupp || {};
_smartsupp.key = 'YOUR_SMARTSUPP_KEY';
_smartsupp.orientation = "left";
// ...rest of your installation code (the loader)
</script>

Move the chat box away from its default position (values in pixels):

_smartsupp.offsetX = 20;  // moves it away from the side edge
_smartsupp.offsetY = 100; // moves it up from the bottom edge

Use a different position on mobile only:

<script>
var _smartsupp = _smartsupp || {};
_smartsupp.key = 'YOUR_SMARTSUPP_KEY';
if (window.innerWidth < 768) {
  _smartsupp.offsetY = 150;
}
// ...rest of your installation code (the loader)
</script>

Hide the chat box on mobile only (it stays visible on desktop, available on all plans):

_smartsupp.hideMobileWidget = true;

To implement it:

  1. Open your website's code and locate the Smartsupp installation script.

  2. Add the options you need right after the _smartsupp.key line, before the loader.

  3. Adjust the values to suit your design.

  4. Save your changes and reload your website in an incognito or private window to check the new position. Check the mobile version on a phone, too.

💡 Tip: Commands such as smartsupp('chat:position', ...) are not supported. The chat box ignores them and your browser console shows "Unknown API command". For all configuration options, see the developer documentation.


What's next?

💡 Need more help? Contact our support team — we’re happy to assist!

Did this answer your question?