Radiant Media Player

Ad-blocker detection



Documentation sections


Your business model is at risk

As of Q2 2015, 45 million Americans were using ad blockers. In a survey research study released Q2 2016, MetaFacts reported 72 million Americans, 12.8 million adults in the UK, and 13.2 million adults in France were using ad blockers on their PCs, Smartphones, or Tablets.

Wikipedia https://en.wikipedia.org/wiki/Ad_blocking

The 2017 PageFair report shows that 11% of the global Internet population is blocking ads on the web (as of December 2016). In some countries like Germany, Sweden, India or Indonesia this figure is well above 25%.

Stop revenue loss today! You have the right to counter ad-blocking software to keep your business going.

An ad-blocker detection strategy should be in any project serious about making legitimate revenue with video ads.


Ad-blocker detection strategy

Since Radiant Media Player 4.6.21 the ad-blocker detection logic is built in the player and based on BlockAdBlock. This options is turn off by default as some users may want to have an ad-blocker detection policy at the site level and not at the player level. Also note that enabling ad-blocker detection within Radiant Media Player may cause a slight delay in loading and displaying ads when no ad-blocker is detected (typically 200 ms, which is the time required for the ad-blocker detection script to confirm the presence or not of an ad-blocker).

Assuming you are turning on ad-blocker detection within Radiant Media Player (see adBlockerDetection setting below), 2 options for detecting ad-blocker are available:

  • Passive strategy: the player will detect the presence of an ad-blocker and will fire API events when required but it will not take any action when an ad-blocker is detected. It is up to you to act upon API events or not. The player will attempt basic counter-measures to allow ads to play by switching from Google IMA to rmp-vast but there is no guarantee this will allow ads to render. This is the default.
  • Active strategy: the player will detect the presence of an ad-blocker and will fire API events when required but will also prevent playback of content when an ad-blocker is detected. A customisable message will be shown to the viewer asking to disable the ad-blocker in order to access content.

As discussed in our blog post it can prove challenging to by-pass ad-blockers. Several initiatives in the ad-tech industry are emerging to address the issue and browser vendors are also starting to work on the subject so the game is likely to change in the years to come.


Ad-blocker detection player settings

adBlockerDetection: Boolean

Whether or not the player should attempt to detect ad-blocker when init is called. Default: false.

adBlockerDetectedPreventPlayback: Boolean

Whether or not to prevent playback of content when an ad-blocker is detected. When playback is prevented a customisable message is shown to viewer requesting the ad-blocker to be disabled. Default: false.

adBlockerDetectedMessage: String

When playback is prevented the adBlockerDetectedMessage message is shown to the viewer. Default: 'Ad-blocker software detected. To view this content please disable your ad-blocker.'.


Ad-blocker detection player API

Note that the ad-blocker detection player API is only available when adBlockerDetection is set to true.

Player API event

  • adblockerdetected: this event fires when an ad-blocker is detected after init is called on player. Note that this event will fire just after ready event if an ad-blocker is detected.

Player API method

  • getAdBlockerDetected: this method will return a Boolean stating if an ad-blocker has been detected or not.

Player code example

<script src="https://cdn.radiantmediatechs.com/rmp/5.0.8/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
  var src = {
    hls: 'https://your-hls-url.m3u8'
  };
  var settings = {
    licenseKey: 'your-license-key',
    src: src,
    width: 640,
    height: 360,
    poster: 'https://your-poster-url.jpg',
    ads: true,
    adTagUrl: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml',
    // ad-blocker detection settings
    adBlockerDetection: true,
    adBlockerDetectedPreventPlayback: true,
    adBlockerDetectedMessage: 'Ad-blocker detected - to access this content we ask that you disable your ad-blocker',
  };
  var elementID = 'rmpPlayer';
  var rmp = new RadiantMP(elementID);
  var container = document.getElementById(elementID);
  container.addEventListener('adblockerdetected', function () {
    console.log('adblockerdetected');
  });
  container.addEventListener('ready', function () {
    console.log(rmp.getAdBlockerDetected());
  });
  rmp.init(settings);
</script>

Tested ad-blockers

Over the past few years we have seen many ad-blocker solutions coming to the market. Most common ad-blockers are browser extensions generally "free" to install. It is also to be noted that browser vendors are starting to implement (or are showing interest into implementing) their own ad-control strategy. We have tested our ad-blocker detection approach against:

  • Adblock Plus
  • AdBlock Pro
  • AdBlock
  • uBlock

Feel free to contact us with feedback on detecting ad-blockers.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.