<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.1/js.cookie.min.js"></script>
<script type="text/javascript">
/* Set these variables */
var shipScoutIncludedCountryCodes = ["DE", "AT"] //include alpha-2 country codes https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
/* Do not modify code below */
var shipScoutProcessCountry = function(countryCode) {
window._shipScout = window._shipScout || [];
_shipScout.push(function(response) {
// Check to see if the visitor's country is NOT in the included countries list
if (shipScoutIncludedCountryCodes.indexOf(countryCode) === -1) {
//hide the ShipScout banner
console.log("ShipScout: Banner hidden for visitors in " + countryCode)
document.querySelectorAll('.shipscout-banner').forEach(function(banner) {
banner.style.display = 'none'
//Check for "sc_country" cookie
if (Cookies.get('sc_country')) {
shipScoutProcessCountry(Cookies.get('sc_country'))
// Make a request to ipinfo
var shipScoutXhr = new XMLHttpRequest();
shipScoutXhr.open("GET", '/browsing_context_suggestions.json');
shipScoutXhr.onreadystatechange = function() {
if (this.readyState === XMLHttpRequest.DONE) {
if (this.status === 200) {
var data = JSON.parse(shipScoutXhr.responseText)
if (data && data.detected_values && data.detected_values.country && data.detected_values.country.handle) {
shipScoutProcessCountry(data.detected_values.country.handle)
Cookies.set('sc_country', data.detected_values.country.handle)
console.log('ShipScout: Error with country lookup')
console.log('ShipScout: Error with country lookup request')