This article is also available in:
If you need to block traffic from ads spy tools, this script below can help you do so


From your store admin, go to Online Store > Preferences
Scroll to the Additional scripts > Head section and paste this scripts.

var blockReferrer = ['', '', '', ''];

var cName = "__clfref"; function setCookie(e,o,t=2147483647){var n=new Date;n.setTime(n.getTime()+t);var r="expires="+n.toUTCString();document.cookie=e+"="+o+";"+r+";path=/"}function getCookie(e){for(var o=e+"=",t=decodeURIComponent(document.cookie).split(";"),n=0;n<t.length;n++){for(var r=t[n];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(o))return r.substring(o.length,r.length)}return""}function delete_cookie(e){document.cookie=e+"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"}window.sbsdk.ready(function(){var;-1!=document.referrer.indexOf(e+"/admin")&&delete_cookie(cName),""!=getCookie(cName)?window.location.href="":document.referrer&&""!=document.referrer&&blockReferrer.some(function(e){if(-1!==document.referrer.indexOf(e))return setCookie(cName,1),window.location.href="",!0})});

You can add, update blockReferrer value as desired

Save and you are done, all traffic from spy tools will be blocked to access your store.

If you're accidentally blocked by visiting your site via a spy tool, just login into your dashboard, open your site to restore access your site normally.
Due to technical complication, it can be impossible to block some spy traffics so we can only provide limited support to this issue.
Note that if you use http domain to redirect via https domain, our script block will not be able to detect spy website source.
Was this article helpful?
Thank you!