Welcome To Our Customer Service Portal


How do I get the widget to work with CDN?

What is CDN?

CDN is a system of distributed servers that delivers the content of the webpage based on the user's geographical location.

How does CDN work in Nanorep?

You can add CDN capabilities to Nanorep's widget to increase their performance. By recognizing the users' geographical location, the CDN will load the widget from the fastest server available for that particular user.
 

How do I implement CDN capability in the widgets?

Floating widget:

1. Locate the following line in the floating widget's script.

'my.Nanorep.com/widget/scripts/float.js'

2. Add cdn-  to the beginning of that line.

3. Your script should now be similar to the following example.

<!--do not modify this script -->
<div class='Nanorep_loadingData' id='NanorepProxyContainer'  aria-live='polite' style='position:absolute;top:-500px;left:0px;'></div>
<script type='text/javascript'>var _nRepData = _nRepData || []; _nRepData['kb'] = '36002738'; _nRepData['float'] = {account: 'arieldemo', cdcVersion: 3, cdcFrame: '', scriptVersion: '2.56.1.8'}
/* API here */;
(function(){var windowLoadFunc = function(){var _nRepData = window._nRepData || [];_nRepData['windowLoaded'] = true;if (typeof(_nRepData['windowOnload']) === 'function') _nRepData['windowOnload']();};if (window.attachEvent)window.attachEvent('onload', windowLoadFunc);else if (window.addEventListener)window.addEventListener('load', windowLoadFunc, false);var sc = document.createElement('script');sc.type = 'text/javascript';sc.async = true;sc.defer = true;sc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn-my.Nanorep.com/widget/scripts/float.js';var _head = document.getElementsByTagName('head')[0];_head.appendChild(sc);})();
</script>

4. Implement the new script in your website.
 

Embedded widget:

1. Locate the following line in the floating widget's script.

'my.Nanorep.com/widget/scripts/embed.js?account=arieldemo'

2. Add Add cdn-  to the beginning of that line.

3. Your script should now be similar to the following example.

<!--do not modify this script -->
<div aria-live='polite' id='NanorepEmbedContainer'></div><script type='text/javascript'>var _nRepData = _nRepData || []; _nRepData['kb'] = '36002738';
/* API here */;
_nRepData['embed'] = {account:'arieldemo', container: 'NanorepEmbedContainer', width:400, maxHeight:500, dynamicSize: true, cdcFrame:'', cdcVersion:3, scriptVersion: '2.56.1.8'};(function(){var windowLoadFunc = function(){var _nRepData = window._nRepData || [];_nRepData['windowLoaded'] = true;if (typeof(_nRepData['windowOnload']) === 'function') _nRepData['windowOnload']();};if (window.attachEvent)window.attachEvent('onload', windowLoadFunc);else if (window.addEventListener)window.addEventListener('load', windowLoadFunc, false);var sc = document.createElement('script');sc.type = 'text/javascript';sc.async = true;sc.defer = true;sc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn-my.Nanorep.com/widget/scripts/embed.js?account=shadow';var _head = document.getElementsByTagName('head')[0];_head.appendChild(sc);})();
</script>
 
4. Implement the new script in your website.