Detect Ad Blocker in WordPress using AdSense

Many users these days install various extensions and addons on their browsers to block advertisements on the website they visit. This has led publishers to decrease their AdSense earnings.

Today in this post we will discuss how we can detect ad blockers and show an ad recovery message to users to disable or remove the adblocker. This way we will be able to bypass the adblocker extensions installed by users.

Example of ad blocker detection & ad recovery message.
Fig: Example of ad blocker detection & ad recovery message.

Reminder: This post is focused on ad blockers that block Google AdSense’s advertisements. And we will be using Google AdSense itself to detect ad blockers and show ad blocking recovery messages. In case, you are wondering how to get started with Google AdSense, you can read our detailed guide on getting approval with Google AdSense in WordPress website.

Also Read: Fix Google AdSense Ad Serving Limit

Highlights of this posts

  • Overview of ad blockers.
  • Setting up Google AdSense Ad Recovery tool to show recovery messages to site visitors who have installed ad blockers on their web browsers.
  • Customize the appearance & placement of ad recovery message.

What are ad blockers?

Ad-blockers are software that are designed to block online advertisements from websites and apps. Their purpose is to enhance the browsing experience for users by getting rid of unwanted ads. 

Ad-blockers work by blocking requests to servers that serve advertisements. Some ad-blockers also offer the option of customizing the type of ads that are blocked, such as pop-up ads, auto-play video ads, etc. The use of ad-blockers has become a contentious issue in the online advertising industry as it can significantly reduce the revenue of publishers who rely on ad revenue only.

Identify ad blockers and show ad blocking recovery message using AdSense

For this method to work you need to have an active AdSense account. We will be using an AdSense account to generate an ad blocking recovery message which we will insert in our WordPress site using the WPCode plugin.

For this method we suggest  you install a plugin called WPCode. Using this plugin you will be able to add code snippets to your WordPress site without having to touch the theme files. 

If you are new to WordPress and do not know how to install a WordPress plugin we suggest you read our detailed guide on installing WordPress plugins.

Tagging your website

The first step in identifying ad blockers using AdSense is tagging your site. For that you need to:

Step 1: Login to your AdSense account

Step 2: Go to Privacy & Messaging >> Ad Blocking Recovery

AdSense Privacy & Messaging Tab
Fig: AdSense Privacy & Messaging Tab

Step 3: Select on “Tagging”, then you will see two codes. Copy the first code

AdSense Ad Blocking Recovery Tab
Fig: AdSense Ad Blocking Recovery Tab
Ad recovery tagging in AdSense.
Fig: Ad recovery tagging in AdSense.

Step 4: In your WordPress website after installing WPCode, go to Code Snippets >> Add new

Step 5: Give the title to the snippet may be “AdSense Ad Blocking Message”

Step 6: Paste the code you copied from AdSense

Step 7: Change the code type to “Universal Snippet”

Step 8: Make the snippet active and save the snippet.

Fig: Adding Ad Recovery Code in WordPress website using WPCode.

This way you have done tagging your WordPress website, now is the time to customize the Ad blocking recovery message.

Customizing Ad Recovery Message

Step 9: Now from the “Ad blocking recovery” tab in your AdSense account go to “Messages” tab. Turn on the Ad Blocking Recovery by clicking on “Create Message”

Adding Ad Recovery Message in AdSense.
Fig: Adding Ad Recovery Message in AdSense.

Step 10: After you click on “Create Message” you need to add your site, to which you want to show the message. You will only see the sites that are approved on your Google AdSense.

Adding Site for Ad Recovery Message in AdSense.
Fig: Adding Site for Ad Recovery Message in AdSense.

Step 11: Select the site you want and upload logo of your website (Logo Specifications: PNG or JPG; no more than 150kb and 5:1 recommended aspect ratio)

Step 12: Click on confirm and then select language of your website  and click on “Continue”

Step 13: After that you will see how the ad recovery message will be seen to the website visitors. From this tab you can change the styling of the message with different fonts and colors. You can also customize the placement of the message, make the message dismissible or un dismissible. Finally you can click on “Publish” and your ad recovery message will be seen to visitors who have ad blockers enabled on their browsers.

Publishing Ad Recovery Message in AdSense.
Fig: Publishing Ad Recovery Message in AdSense.

Wrapping Up

In this post we learnt the step by step tutorial to bypass the ad blockers of visitors by showing an ad recovery message using AdSense’s Ad Recovery Message Tool. This way publishers will be able to save their earnings from their site. If you have any further questions regarding the topic, you can ask us in the comment section.

Leave a Comment