If you’re running a Shopify store and you want to prevent spy tools such as Ali Hunter, PPSPY, and Commerce Inspector from accessing your site, there are a few things you can do:
Step 1: Add Scripts to theme Code
To add this code to your Shopify store, follow these steps:
- From your Shopify admin panel, navigate to Online Store > Themes.
- Click the “Actions” dropdown menu and select “Edit code.”
- Locate the theme.liquid file and click to open it.
- Find the <head> section of the file and paste the code snippet above just before the closing </head> tag.
- Save the changes and test the code to ensure it’s working as expected.
<script> var blockReferrer = ['adspy.com', '0refer.com', 'spybadao.com', 'spypro.io']; 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 e=window.sbsdk.shop.getPlatformDomain();-1!=document.referrer.indexOf(e+"/admin")&&delete_cookie(cName),""!=getCookie(cName)?window.location.href="http://google.com/not-found":document.referrer&&""!=document.referrer&&blockReferrer.some(function(e){if(-1!==document.referrer.indexOf(e))return setCookie(cName,1),window.location.href="https://www.google.com/not-found",!0})}); </script>
<script> window.oncontextmenu = function () { return false; } </script>
<script type="text/javascript"> var spyTools = ["Ali Hunter", "PPSPY", "Commerce Inspector"]; var userAgent = window.navigator.userAgent; for (var i = 0; i < spyTools.length; i++) { if (userAgent.indexOf(spyTools[i]) !== -1) { window.location.href = "https://www.example.com/blocked.html"; // Replace with the URL you want to redirect the spy tools to } } </script>
Step 2: Install an Anti-Spyware App
There are several apps available on the Shopify App Store that can help protect your store from spy tools.
By taking these steps, you can help prevent spy tools from accessing your Shopify store and protect your business from unauthorized data collection. These steps may not completely prevent spy tools from accessing your Shopify store, but they can help make it more difficult for them to do so. It’s important to stay vigilant and regularly review your store’s security measures to ensure that you’re doing everything you can to protect your business.