For the complete documentation index, see llms.txt. This page is also available as Markdown.

How to work with AdBlock Dynamic Domains API

AdBlock tools are increasingly sophisticated, posing significant challenges for publishers seeking to maximize revenue from online advertising. To help mitigate these challenges, this API allows publishers to dynamically adjust their scripts based on active domains, significantly reducing the risk of content being blocked by AdBlock software.

By ensuring ad delivery through regularly rotated domains, publishers can:

  • Maintain Revenue Streams: Prevent interruptions caused by blocked ads.

  • Enhance User Experience: Deliver ad content seamlessly without triggering AdBlock detection.

  • Automate Domain Management: Eliminate manual updates with an automated 7-day domain lifecycle.

New domains are generated every 3 days and are available through the API. The domains will have a 6-day lifecycle.

  • 3 days active

  • 3 days deprecated

Once the lifecycle expires, the domain will be deactivated. For performance reasons, it is recommended to cache the domain for 24 hours before requesting a new domain from the API.

This API is only available for Popunders inline-script and In-Stream Video zones.

Requirements

To use this API, publishers need to:

  • Make a GET request to the endpoint: https://ads.exoclick.com/adblock-domains.php

  • You will receive a new ad-serving domain in the response

  • You must then change the syndication endpoint used on your ad zone tag to the new one provided in the API response.

Steps to Implement

1

Fetch the Active Domain

To retrieve the active Domain dynamically, you must make an API call server-to-server. This is crucial because API calls can be blocked if called from the client side.

Here is an example server-to-server call in PHP:

And here is the expected response from the API:

2

Update Your Script

Use the domain returned from the endpoint to update the domain used in your ad zone. The original domain depends on the ad format:

  • For In-Stream Video zones change the VAST Tag:

    • Before : https://s.magsrv.com/v1/vast.php?t={random}&idzone={zoneId}

    • After : https://newsub.newdomain.com/v1/vast.php?t={random}&idzone={zoneId}

  • For Popunders zones change the syndication_host on the inline script:

    • Before : s.pemsrv.com

    • After : newsub.newdomain.com

Detecting AdBlock

In order to detect whether the user has an adblock extension enabled, you must host ads.js on the publisher side (your own domain/CDN) and include it at the very beginning of your body tag.

Do not request https://www.exoclick.com/ads.js directly.

Create your own ads.js file:

  1. Create a file named ads.js in a public path on your website (for example /js/ads.js).

  2. Add the following content to that file.

  3. Load that file from your page before your ad integration logic.

Reference file content:

Then add the following line at the very beginning of your body tag:

This script will be blocked by Adblock in case of the client is using it, due to the presence of the "exoclick" and "ads" keywords. After loading this script, a JS snipppet will attempt to read a specific variable. If the variable is undefined or inaccessible, we can determine that the script as been blocked.

Integration Examples

In these two examples we are using fetchAdblockDomain.php as the name of the server-to-server call to fetch the adblock domain.

In-Stream

In order to use Dynamic Domains with In-Stream, make sure to include the VAST player inside the script, otherwise the player will load the default in-stream ad zone instead of using the updated domain. In this example, we are using Fluidplayer HTML5 player.

Popunder

Troubleshooting

No domain returned

Sometimes, the endpoint might return empty domains.

Always log the endpoint’s response during debugging to identify potential issues. If success is false, contact support.

Default domain returned despite having Adblock enabled

Here are some common reasons why your script might be using the default domain despite Adblock being enabled:

  • ads.js is not hosted on the publisher side. This integration requires serving ads.js from your own domain (for example /js/ads.js). Directly requesting https://www.exoclick.com/ads.js is not supported.

  • default domain being rendered before adblock domain. Make sure that the script inserting the ad zone on your site awlays waits for the server-to-server call. Depending on the execution chain, the default domain might be added to the site before the adblock domain is returned, which will prevent your website from inserting the updated domain.

For further assistance, contact the support team here.

Last updated

Was this helpful?