Show affiliate ads as AdBlock alternative content

AdBlock, one of the most hateful tool to all the bloggers and webmasters around the world as it is keep getting bigger and acquiring more users every single day. As per a statistical report published by PageFair Limited on September 9 2014, there are about 144 million active adblocking software users around the world. The usage of AdBlockers on internet has been grew nearly 70% between June 2013 – June 2014. It has been seen that the AdBlock usage growth is highest for Google Chrome (world’s most popular internet browser) and adblock growth driven by Google Chrome is nearly doubled in last one year. It has also been seen that AdBlock usage is mostly driven by young internet users. Almost 41% of 18 – 29 years old people are using adblock right now on their browser and this usage is on a high rise.

So, I hope you can clearly see that in near future when almost 80% – 90% of your website or blog readers will be visiting your site by installing AdBlock on their browser. Now this brings us to the most important question –

How should we monetize our websites and blogs then? Without monetization the Open Source concept is dead.

This is very much true. Some internet users think that website owners put advertisements on their site to be rich, but in reality they do it to fund their website instead. Some, who does support AdBlock concept, argue that it’s better to put a “Donation” button than monetize sites with ads. But again in real life, very few people actually donate for the works bloggers do every day. People like free stuffs but not supporting the authors.

What’s the future then?

Well, as we see the exceptional growth of AdBlocker usage, it clearly shows that in near future most blogger won’t be able to afford the domain, hosting and other website maintenance cost and in the end they starts losing interest in it and stop blogging. As a result, the whole internet community is going to run out of fresh open source free content. Just like newspapers, people have to pay monthly fees to subscribe to blogs and to read their posts. Here is an awesome presentation by PageFair about the massive increase of AdBlock usage in past year.

What about AdBlock alternative?

As I said earlier on my other post about how adsense account gets blocked by misuse of adblock alternative content that if you ask your readers to disable AdBlock for your site that is actually a violation of AdSense policies. And as we all know that they are very strict about it, so they will disable your AdSense account anytime they want, without paying you any money at all. I’ve also mentioned on the article that the smartest way to show AdBlock alternative content is by saying nothing related to ad and by showing Affiliate Ads for AdBlock enabled users.

So how to show affiliate ads as AdBlock alternative?

Well, if you surf on the web, you will see that many bloggers has shared some code snippet to do that trick. But the trick which is mostly available on the web is not the right way to do it mostly because it manipulate the provided Adsense code, which is again aginst Google Adsense policy. Also the mostly available code snippet on the web will only work for Asynchronous version of Adsense code, not for the synchronous version of it. This was really annoying so I wrote my own code from the scratch with a very different implementation approach which I’m going to share below in this post. This code snippet is written by using jQuery and if you are a WordPress user, you don’t have to add jQuery separately as WordPress already comes with jQuery library preloaded.

What you have to do is to understand the exact positions where you need to make the changes in the given code and then copy the code and paste it in your site with your own affiliate ad codes. With this code snippet you can create your own affiliate ad stack and then show affiliate banner ads randomly for AdBlock enabled users. So, let’s get started.

Prerequisite

Go to your affiliate sites and copy the banner ad code you want to use.

Paste the code into a notepad and copy the image url (src attribute of img tag) and open it in your browser. (e.g. http://example.com/ad.jpg)

Save the image in your computer with a random name (e.g. QtgYulk.jpg)

Now upload the random named image file into your server (or media library of WP dashboard).

The above steps are must needed otherwise AdBlock is going to block your affiliate ads too, as AdBlock is a very sophisticated extension which block files if it has names with “ad” or any kind of ad size (300×250) embedded into it. So, now it’s time for the actual alternative code. Also without the div, the alternative content won’t gonna work. So, now its time to check the code.

The Magic Code (name given by me 😀 )

Do not share or showcase the above codes in any other blog post or website without prior permission from the author.

Why can’t people just disable AdBlock?

Well, web is not as beautiful as we think off it in our dreams. Most of websites on the web runs from copying content from other sites or sharing pirated contents and many other nasty stuffs. So these guys never gets approval from Adsense to show ads on their site and they end up showing garbage annoying animated, music or popup ads on their site just for few penny.

So, people get frustrated with these sites and install AdBlock globally. Most AdBlock users don’t even know how to whitelist a specific website or blog or domain on their adblocker. So, for the annoyingness of few ad agencies and webmasters, the whole web pays its price.

Is showing alternate content is a good idea?

Well, if you ask me as a professional experienced webmaster, I will say NO. It degrades user experience of your website. If a user already installed AdBlocker on his/her browser, then he/she definitely don’t wanna see any ads for sure. But with showing alternative affiliate ads you are technically blocking their freewill of using the web. Also even if you force these users to see affiliate banner ads on your content, they will rarely click on it and make a purchase. But still it is worth doing, even if the conversion probability is 1%, because you need to fund your website for various maintenance cost, server cost etc.

Doesn’t big corporate face losses due to this?

Companies like Google, Amazon, Microsoft uses their advertisement medium as their primary source of money for their business. Google AdWords is the system which bags most of the revenue Google earns every year. But hey, these are big corporates with billion dollars funding and recently Google, Microsoft, Amazon and Taboola are paying a hefty amount of money to Adblock Plus developer team to whitelist their websites by default in the Adblock plugin. So in future updates these website will still showing ads even if adblocker is installed and will keep earning billions of dollars, but for you and me, still the general rule applies.

Does this work for Adsense only?

Not at all. I’ve written this code with a very generalist approach so that it works with every kind of ad code. Whether it is adsense or any other ad agency, this ad code will work flawlessly without any issues. So, enjoy every bit of it regardless of what ad medium you use to monetize your website. 🙂 But make sure, the above code is made for banner ads only, not for any kind of annoying popup ads.

What about support?

As you see that this is a completely free blog post and I’m not selling anything to you, so please understand that there is no warranty or support involved in this. Tough I’ll try my best to reply as much comments as possible related to minor problem or issues. But any comment or request related to modifying or upgrading that code will not be entertained for free. Sorry guys. 🙁 But again, I’ll try my best to help as much people as I can 🙂

Conclusion

Tough showing AdBlock alternative content will technically degrade user experience in your site, but if you still want to show it for many possible reason, make sure you do it smartly and don’t make any mistakes. I will definitely suggest you to read how AdBlock alternative content can block your adsense account to know more about Google policies regarding AdBlock alternative content. Even if you get 1% conversion from these affiliate ad banners, it is still better than nothing. Isn’t it?

Feedback

So what do you think about AdBlock usage increasing exponentially every year? Does AdBlock also affecting your business or blogs? Do you use any other type of AdBlock alternative? Did this article helped you? Let me know in the comment section below. I’ll love to read back from my readers.

Also from now on I’m going to release at least one article each week especially for bloggers and webmasters with news how tos, tips, reviews and more. So, if you have any special request for any topic, feel free to let me know in the comment section below.

You can also follow me on twitter @iSaumya or subscribe to my newsletter to always stay updated with my new posts. Also if you like my work, please give me a kudos for it.

Sorry! I didn’t get you which one I’m not implementing on on own site? Everything I post here is been thoroughly tested and mostly implemented on my own site. I also show alternative affiliate ads for those users who have adblock enabled and I’ve shared the exact code that I use personally and written personally for my site. Anyways I still did not get why you are not happy and what I’m not using. 🙂 It would be great if you can share it in a bit detail manner 🙂

That’s kind a wired. Because I’ve tested the script with AdBlock, AdBlock Plus, uBlock and for all of them, it seems working fine. I’ve no idea why you guys are not seeing this. You might consider refreshing your page.

Overall good article, but this is something which isn’t feet into my mind – “But hey, these are big corporates with billion dollars funding and recently Google, Microsoft, Amazon and Taboola are paying a hefty amount of money to Adblock Plus developer team to whitelist their websites by default in the Adblock plugin. So in future updates these website will still showing ads even if adblocker is installed and will keep earning billions of dollars, but for you and me, still the general rule applies.” – If so, than all companies start making adBlocker plugins and start asking for money from Google, microsoft, amazon etc. etc. etc. isn’t it ?

Hi Sameer, you got this whole thing in a very wrong way. You see, the companies like Google microsoft are not paying Adblock to show Adsense ads to the adsense enabled sites, They are paying the money so that adblocker doesn’t block ads for their own sites. Like the ads on Google search pages, on youtube videos, within gmail – these ads, not the adsense publisher ads. 😉

Very interesting post to pass through adblocker. I have a question, how can we manage with your code responsiveness, is there a way to show different Affiliate ads sizes depending of the size of the window like I already do with adsense? Thanks!

yes, that is a really good question indeed, specially as we all uses adsense responsive ad code now. Adsense uses css media queries to show up responsive ad but that trick will not work with this code because you have to do everything on jQuery. So, instead what you have to do is you have to create array of different ad sizes and then check the screen size within jQuery and then based on that data you have to show up respective affiliate ads from respective ad array size. Sorry! As this is a free script can’t help you more with customizing, but I have already gave you everything you need to make it happen. 🙂

Install a plugin named Insert Headers and Footers and then you can add that magic code to the section where it says script for footer. Just make sure you add <script> at the beginning of the code and </script> at the end.

Hi, i did exactly as you said and i have one problem. It’s working with an ad in the sidebar but it’s not working when i put the ad in the header (wordpress). I see only empty space in header with adblock enabled. Do you know how to fix it or where i might made a mistake?

That’s not possible mate, unless you did something wrong. Actually when I wrote this code I used to use this not only for my sidebar ad but for all ads within my post and every place else. It will work for all ad places unless you did some mistake. In that case it’s not possible for me to debug your code or to provide free support. Sorry man.

Sorry, my comments was edited by your system because it contained the word s-c-r-i-p-t. I was just saying that some of us noobs don’t know to add those tags to the beginning and end of code. I was wondering why it wasn’t working for me until I say you mention that in the comments section.

If you look at your comment above to Anuj, all I was saying was that the advice you gave him is something I needed to make it work in my application. Adding those tags. I too was using something that does script for footer, just not WordPress. But it didn’t work until I added those tags.

I’ve implemented your code on my websites and it works well with chrome & firefox. But with safari on Mac OS X or iOS or when on iOS it does not work well, in fact the affiliate ads are displayed even if no adblock is present. Have you tested it with safari or on iOS? Do you know what could be wrong or what can be done to make it work well on those browser/device? Thanks for your help,

As ad-blockers are becoming more prominent, the solution suggested by Saumya sounds awesome!

I see in the blog post that it is mentioned that donations is not a possible solution.

But Adzcoin has recently come up with a solution along this lines. The difference is, the visitors keep earning free coins (adzcoin), which they can donate to the deserving publishers? Will this make a difference? I think so…

I put the code in footer as it is starting from “var adArray = [];” before the closing body tag. Then wrapped the adsense ad code in the div you provided. But this didn’t work. The ad was appearning at the footer where I placed the code and not at the place where adsense ad needs to be replaced.

Is the code starting with “var adArray = [];” needs to be wrapped in script?

However, just wondering in terms of responsive design, how do I implement this to cater to different ad sizes for different browser sizes. Do you mind pointing out the most basic implementation on how I can include some kind of css media queries to solve this issue?

Hi Jhon, if you want to show different images for different screen size, for example if it is a PC, when show affiliate ad banners of 728X90 but if it is a phone then show 300X250. There is no easy css way to do this as everything hever is getting pushed by jQuery. So, what you have to do is, you have to create 2 array inside your jQuery. One for the 728X90 banners and one for 300X250 banner. Then within the jQuery code you can run a if statement for checking the screen width like this: if ($(window).width() > 748 ) then show up big affiliate banner or show up small affiliate banner. That is the only way.

Hi, I’m really sorry that this is a bit technical. But if you have basic HTML and JS knowledge you will see how easy it is to implement, as I’ve already provided the entire code. It just needs to be connected with your content. If you show this to anyone with some basic HTMl and JS knowledge, he will definitely understand it. I’m really sorry that you didn’t understood it. But trust me I’ve already explained in an extremely easy manner, not sure how to explain it even further.

Subscribe To My Newsletter

You are almost there! Just check your Inbox to confirm the Subscription & you are all set.

A Little About Me

Hi, I'm Saumya Majumder, an engineer, tech enthusiast & programmer. Here in this blog I write mostly about starting & managing a blog, WordPress, Social-media, SEO and Making Money online, Adsense, latest tech products and software and many more thing. If you are also into the tech arena, you will definitely love the content of this blog (I hope).

Subscribe To My Newsletter

You are almost there! Just check your Inbox to confirm the Subscription & you are all set.

Shares

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.