Installation guide

Everything you need to connect a website to AdCobalt.

1. Add the snippet

After adding your website in the dashboard, copy your personal snippet. It looks like this:

<script async src="https://adcobalt.com/embed.js" data-publisher="pub_XXXXXXXXXXXXXXXX"></script>

Use the snippet from your dashboard: it contains your own publisher ID. The same snippet works on all websites in your account.

2. Where to place it

Paste the snippet just before the closing </body> tag of every page, or once in the shared template, layout or footer include that every page uses.

The script is asynchronous and will not block rendering. Placing it in the <head> also works.

WordPress and other CMSs

  • WordPress: use a header/footer code plugin or add the snippet to your theme's footer.php before </body>.
  • Shopify: Online Store → Themes → Edit code → theme.liquid, before </body>.
  • Wix, Squarespace and similar: use the custom code / code injection setting for the footer.
  • Google Tag Manager: create a Custom HTML tag with the snippet that fires on all pages.

3. Check the connection

Open any page of your website in a normal browser window. Then click Check connection in the installation dialog. The website status changes to Connected after the first page view reaches AdCobalt.

Publishing a notice and connecting the script are separate: a published notice is only shown once the script is installed.

Recovery modes

  • AdBlock Wall: a non-dismissible dialog while blocking is confirmed. Visitors can open instructions and check again.
  • Friendly Reminder: a dismissible message with frequency controls.
  • Monitoring only: measurement without any visible message. Nothing is shown until you publish a notice.

Targeting rules

Notices show on every page by default, including the homepage. To test a newly published wall, open your website with your ad blocker enabled.

You can exclude paths such as /login or /checkout. A rule matches the path itself and everything below it. End a rule with * to match any path that starts with it.

Show from page N and Wait count across the whole visit: every page and tab of your site, starting when the visitor arrives. A visit ends after 30 minutes without a page view, so to test them again use a private window.

Ad-free memberships

Visitors who keep their ad blocker can pay you for an ad-free membership instead of allowing ads. It is optional and off by default.

  • Connect Stripe on the Members page. Members pay into your own Stripe account; you are the seller, so Stripe sends receipts in your name and you handle refunds, disputes and taxes there. AdCobalt keeps 8% of each payment (Stripe's own processing fee applies as usual).
  • Turn on the offer in the Recovery Builder (Members tab), choose a monthly price and optionally a yearly one, then publish. The “Go ad-free” button only appears once Stripe can take payments.
  • Add a link to #adcobalt-membership in your footer or menu, for example <a href="#adcobalt-membership">Membership</a>. Members use it to manage or cancel; other visitors can join or sign in.
  • Members never see the notice. To also skip your ads for them, wrap your ad code: (window.adcobaltQueue = window.adcobaltQueue || []).push(function (ar) { if (!ar.isMember) { /* load ads */ } }); The script also fires an adcobalt:ready event.
  • Members can cancel at any time in two clicks from the link in their welcome email, from your Membership link, or at the manage page. They keep access until the end of the period they paid for.

The membership is remembered in the browser's local storage on your site. On another device, members sign in with their email.

Single-page applications

The script detects client-side navigation through the History API and treats each new path as a new page view. You do not need to call anything yourself.

Content Security Policy

If your site uses a Content Security Policy, allow the AdCobalt host for scripts and connections. Detection also performs a test request to a common ad host; if your CSP blocks it, detection may return inconclusive results more often.

Testing with an ad blocker

  • Install the script and publish the AdBlock Wall.
  • Enable an ad blocker (for example uBlock Origin or AdBlock) and open your website.
  • The wall appears. Click Check again without changing anything: the wall stays.
  • Pause your blocker for the site and click Check again: the wall closes.
  • Re-enable the blocker and load another page: the wall appears again.

Troubleshooting

  • Status stays Waiting for installation: make sure the snippet is on the live site and that the domain you registered matches the address in the browser (www and non-www are treated as the same site; other subdomains need their own entry).
  • No notice appears: check that the notice is published, that the page is not excluded and, if you turned on Skip homepage, that you are not on the homepage.
  • Other domains using your code (Websites page): your snippet ran on a domain that is not in your account. Nothing is shown or measured there. Add it if it is yours, or ignore it.

Privacy and storage

The script sets no cookies. It uses local storage on your site to count pages within a visit (a visit ends after 30 minutes without a page view), to remember when a Friendly Reminder was last shown, that the browser saw a notice while blocking ads (up to 7 days) and that it later allowed ads (up to 180 days after its last visit), and, for ad-free members only, a signed membership token. Apart from that token these entries only hold timestamps and counters. AdCobalt does not store visitor IP addresses; detection events are kept for a limited time and then only daily totals remain.

Content-Security-Policy: script-src 'self' https://adcobalt.com https://pagead2.googlesyndication.com; connect-src 'self' https://adcobalt.com https://pagead2.googlesyndication.com