Only show widget for certain country(ies)

With a little customization, you can restrict the country or countries where you show your widget.

Add this snippet to your embed code.

n.setAttribute('data-start-hidden', true);

Then add this javascript and modify it to your needs.

function geoip(data) {
  if (data.country_code === "US") {  // change this to the country code you want to show widget on.
    _chatlio.show();
  }
};

document.addEventListener('chatlio.ready', function (e) {
  var script = document.createElement('script');
  script.src = '//freegeoip.net/json?callback=geoip'
  document.getElementsByTagName('head')[0].appendChild(script);
}, false);

To see it all together

<script type="text/javascript">
  function geoip(data) {
    if (data.country_code === "US") {
      _chatlio.show();
    }
  };

  document.addEventListener('chatlio.ready', function (e) {
    var script = document.createElement('script');
    script.src = '//freegeoip.net/json?callback=geoip'
    document.getElementsByTagName('head')[0].appendChild(script);
  }, false);


  window._chatlio = window._chatlio||[];
  !function(){ var t=document.getElementById("chatlio-widget-embed");if(t&&window.ChatlioReact&&_chatlio.init)return void _chatlio.init(t,ChatlioReact);for(var e=function(t){return function(){_chatlio.push([t].concat(arguments)) }},i=["configure","identify","track","show","hide","isShown","isOnline"],a=0;a<i.length;a++)_chatlio[i[a]]||(_chatlio[i[a]]=e(i[a]));var n=document.createElement("script"),c=document.getElementsByTagName("script")[0];n.id="chatlio-widget-embed",n.src="https://w.chatlio.com/w.chatlio-widget.js",n.async=!0,n.setAttribute("data-embed-version","2.1");
    n.setAttribute('data-widget-id','<REPLACE ME WITH YOUR WIDGET ID>');
    n.setAttribute('data-start-hidden', true);
    c.parentNode.insertBefore(n,c);
  }();
</script> 

NOTE: this uses the free geolocation API provided by https://freegeoip.net and is not affiliated with Chatlio

:(
Your browser is out-of-date!

This website is built using latest technogies. Unfortunately your browser doesn't support those. Please update your browser to view this website correctly. Thank you.Update my browser now