How to block spam traffic from a particular source?

Topic summary

  • Issue: A store owner is receiving daily spam traffic from adlibraryspy.com and wants to block it. They mention a previously “solved” thread but cannot access its content.

  • Proposed workaround: Another participant suggests using Custom JavaScript in a Shopify theme to block by referrer (the URL that sent the visitor). The idea is to detect blocked referrers and redirect those visitors away.

  • Steps provided: In Shopify Admin, go to Online Store > Themes > Actions > Edit code. Open theme.liquid (Layout) and insert a JavaScript snippet before the closing tag to check document.referrer against a blocklist and trigger a redirect.

  • Missing details: The actual JavaScript code is not included, so the implementation specifics are unclear. A personal donation link is shared, but it does not affect the technical approach.

  • Technical notes: theme.liquid is the main layout file; document.referrer is a browser-provided value and can be unreliable if blocked or absent.

  • Status: No confirmed resolution or outcomes. It remains uncertain whether client-side blocking is effective or if a server-side solution is needed.

Summarized with AI on December 27. AI used: gpt-5.

I am getting spammed daily from adlibraryspy.com and I would like to block this, but don’t know how. I saw that there was another question posted about this and marked solved, but for some reason the discussion board will not show me the question or answers to how to fix it.

2 Likes

Hi! I have the same issue. Now I am trying to block them with the Custom JavaScript. If you want to try please follow the instructions below:

  1. Edit Your Theme Code:
    • Go to your Shopify Admin.
    • Navigate to Online Store > Themes.
    • Click on Actions > Edit code for your current theme.
  2. Add Custom Javascript:
    • Open the theme.liquid file (usually located under the Layout folder).
    • Add the following JavaScript code before the closing tag:

This script checks if the referrer is one of the blocked referrers and redirects the user if it is.

Feel free to buy me a coffee if it was helpful :wink:
paypal.me/mxfax