Squarespace

Implement ad blocker detection on your Squarespace site to safeguard ad-based revenue and understand your audience's ad blocker usage

Installation

Target file: Settings → Advanced → Code Injection → Footer

Quick Integration

Add the following script tag to your HTML. Replace the data-key value with your actual API key.

Script Tag
<script src="https://cdn.antiblocker.io/ab.js" data-style="minimal" data-key="abk_****"></script>

Complete Example

Here's a complete example showing where to place the script in your Settings → Advanced → Code Injection → Footer file:

Settings → Advanced → Code Injection → Footer
<script src="https://cdn.antiblocker.io/ab.js" data-style="minimal" data-key="abk_****"></script>

Configuration

Script Attributes

data-keyYour unique AntiBlocker API key (required)
data-styleDisplay style - choose one of 6 variants: "classic", "dark", "educational", "friendly", "minimal", or "urgent"

Implementation Notes

  • Log in to your Squarespace account and access Settings
  • Navigate to the 'Advanced' section and select 'Code Injection'
  • Paste the integration script in the 'Footer' code section
  • The script will be automatically applied to all pages site-wide
  • Click 'Save' to apply your changes

Best Practices

Performance

Place script before closing </body> tag. The script loads asynchronously and doesn't block page rendering.

Testing

Test integration in staging environment before deploying to production. Verify script loads correctly.

API Key

Obtain your unique API key from the AntiBlocker dashboard. Never share your key publicly.

Monitoring

Track detection rates and user responses through the AntiBlocker analytics dashboard.