Script Manager allows you to embed any JavaScript code directly to Samba. There are no boundaries when it comes to its usage: you can use it to create pop-up windows on your e-shop or to add new elements to the editor, for example. JavaScript knowledge is required, though, and should you have any problems with the implementation, please consult your IT team.

From the Samba’s main menu, choose “Script Manager”. There you will be able to edit existing script containers or create completely new ones.

Click on “Add container”, set the name of the container and insert your JS script. For example:

We’ve added a script into our container, which will show a text message "This is a test script" on our e-shop.

Once you add the script, you can save it as a template by clicking Save draft, or directly publish it using the Publish button. For this demonstration, we will use the Save draft button.

After saving, return to the main dashboard of the Script Manager where we can work with all previously created scripts, as previously mentioned. You can now click on the drop-down menu (next to the script's name) and here we have the option to Share the script or simply Delete it.

If you want to test your script, simply use the Test button. This way, we can find out how the script behaves in a real-life environment without actually changing anything on the e-shop.

You can see the script ID in the test environment. From here, you can also share a link directly to this test environment using the Copy activation link button.

You can use the example below (under the button Exit Popup) to see what you can do with your e-shop. Feel free to use this script for your own e-shop, of course.
Following script will create a pop-up window on your e-shop, which will appear after pointing the mouse cursor to the close tab button in your browser.

var startDelay = 5 // seconds
var message = 'Would you like 15% off your first purchase?'
var yesBtnText = 'Yes, get my 15% off'
var noBtnText = 'No, reject this offer'
var coupon = 'FIRST15OFF'

var html =
    '<!DOCTYPE html>' +
    '<html lang=\'en\'>' +
    '<head>' +
    '<meta charset=\'UTF-8\'>' +
    '<meta name=\'viewport\' content=\'width=device-width, initial-scale=1.0\'>' +
    '<meta http-equiv=\'X-UA-Compatible\' content=\'ie=edge\'>' +
    '<title>Document</title>' +
    '<style>html, body {' +
    'margin: 0;' +
    'padding: 20px 0;' +
    'color: #3b3b3b;width:400px;height:200px;' +
    'font-family: Verdana, Geneva, sans-serif;' +
    'overflow: hidden;' +
    '}' +
    'p {font-size: 20px;text-align:center;font-weight: bold;}' +
    'h2 {font-size: 45px;text-align:center;font-weight: bold;display:none;}' +
    '.myButton {background-color:#1abc9c;-moz-border-radius:28px;-webkit-border-radius:28px;border-radius:28px;border:1px solid #1abc9c;' +
    'display:inline-block;cursor:pointer;color:#ffffff;font-family:Arial;font-size:13px;padding:12px 33px;text-decoration:none;text-shadow:0px 1px 0px #2f6627;}' +
    '.myButton:hover {background-color:#16a085;}.myButton:active {position:relative;top:1px;}'+
    '.closeButton {background-color:#768d87;border:1px solid #566963;margin-left:10px;}.closeButton:hover {background-color:#6c7c7c;}' +
    '</style>' +
    '</head>' +
    '<body>' +
    '<p id=\'message\'>' + message + '</p>' +
    '<h2 id=\'coupon\'>' + coupon + '</h2>' +
    '<div id="btn-container" style=\'text-align: center;\'><button class=\'myButton\' id=\'yes\'>' + yesBtnText + '</button><button class=\'myButton closeButton\' id=\'no\'>' + noBtnText + '</button></div>' +
    '</body>' +

var style = '<style>' +
    '.yt-container {position: fixed;width:400px;height:200px;bottom:0;left:0;right:0;top:0;margin:auto;overflow:hidden;z-index:100;border-radius:5px;background-color:white;' +
    '-webkit-box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.75);' +
    '-moz-box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.75);' +
    'box-shadow: 0px 0px 15px 0px rgba(0,0,0,0.75);}' +
    '.yt-close {position:absolute;top:5px;right:5px;}' +
    '.yt-close>img {width:30px;}'

var head = document.querySelector("head");
head.innerHTML += style;
const savedValue = localStorage.getItem('ytExitPopupShowed');
window['ytExitPopupShowed'] = savedValue ? JSON.parse(savedValue) : false;
function openPopup() {
    var id = 'yt-' + Number(new Date());
    var closeFunc = function(e) {
        if (e) {
        var element = document.getElementById(id);
        localStorage.setItem('ytExitPopupShowed', 'true');

    var div = document.createElement('div');
    var closeButton = document.createElement('a');
    closeButton.className = 'yt-close';
    closeButton.onclick = closeFunc
    closeButton.innerHTML = '<img src="">';
    div.className = 'yt-container';

    var iframe = document.createElement('iframe');
    iframe.srcdoc = html;
    iframe.width = "400";
    iframe.height = "200";
    iframe.frameBorder = "0";

    iframe.onload = function() {
        iframe.contentWindow.document.getElementById('yes').addEventListener('click', function() {
            iframe.contentWindow.document.getElementById('message').style.display = 'none';
            iframe.contentWindow.document.getElementById('btn-container').style.display = 'none';
            iframe.contentWindow.document.getElementById('coupon').style.display = 'block';
        iframe.contentWindow.document.getElementById('no').addEventListener('click', closeFunc);


    var backdrop = document.createElement('div'); = 'fixed'; = '100vw'; = '100vh'; = '100'; = '0'; = '0'; = id;

    backdrop.onclick = closeFunc;

    document.addEventListener('keyup', function(e) {
        if (e.which === 27) {
            var element = document.getElementById(id);
            localStorage.setItem('ytExitPopupShowed', 'true');

setTimeout(function() {
    document.body.addEventListener("mouseout", (e) => {
        e = e ? e : window.event;
        const vpWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
        if (e.clientX >= (vpWidth)) return;
        if (e.clientY >= 50) return;
        const from = e.relatedTarget || e.toElement;
        if (!from && !window['ytExitPopupShowed']) {
            window['ytExitPopupShowed'] = true;
}, startDelay * 1000);

This script will create a pop-up window on your e-shop, which will appear after pointing the mouse cursor to the close tab button in your browser.

Did this answer your question?