# Configuration
Modify configurable parts of chat box and its behavior by adding simple one line codes.
First things first
Before you can start with the configuration part, you should have connected Smartsupp to your website according to the Installation guide. Do you have troubles with integration? Contact our support, we'll help you!
You can modify your own chat code. Enter your configuration after the line with _smartsupp.key
All examples are explained below with code samples.
<script type="text/javascript">
var _smartsupp = _smartsupp || {};
_smartsupp.key = "YOUR_SMARTSUPP_CODE";
// ...
// your configuration
// ...
window.smartsupp||(function(d) {
var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
s=d.getElementsByTagName('script')[0];c=d.createElement('script');
c.type='text/javascript';c.charset='utf-8';c.async=true;
c.src='https://www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
})(document);
</script>
# Sub-domains integration
Smartsupp visitor is identified by unique key stored in cookies. By default chat conversation is terminated when visitor opens a sub-domain on your website. You should set main domain as cookie domain if you want chat conversations uninterrupted across your sub-domains. Insert the cookieDomain parameter in your chat code on main domain and all subdomains where you want the chat conversation uninterrupted.
_smartsupp.cookieDomain = ".your-domain.com";
# Hide chat box on certain pages
You can hide chat box on certain pages by setting the variable hideWidget
or hideMobileWidget
in your code.
_smartsupp.hideWidget = true; // use on specific pages
_smartsupp.hideMobileWidget = true; // hide chat box on mobile devices
# Privacy notice
You can manually enable or disable privacy notice in chat box. Also you can specify custom url for your own privacy page. This could be useful when you are using Smartsupp chat across several sites. If you want to make your users' consent required, set up the privacyNoticeCheckRequired
field to true
.
_smartsupp.privacyNoticeEnabled = true; // privacy notice visibility in chat widget
_smartsupp.privacyNoticeUrl = "https://..."; // URL of your privacy page
_smartsupp.privacyNoticeCheckRequired = true; // require user consent
# Position
By default chat box is displayed in the screen bottom right
corner. You can change its position to the left
side by adding the following code to the configuration part.
_smartsupp.orientation = "left";
You can offset (move) chat box from its default position using offsetX
and offsetY
options. The distance is in pixels.
_smartsupp.offsetX = 100; // move along the X axis by 100 pixels
_smartsupp.offsetY = 100; // move along the Y axis by 100 pixels
# Color
You can set a specific color to your chat box.
_smartsupp.color = '#ff0000';
# Rating
You can allow or disallow visitors to rate your support by configuring the value in ratingEnabled
option.
_smartsupp.ratingEnabled = true;