How to block Adblock?

Asked

Viewed 2,808 times

9

I’m setting up a site that works with ads and so I can’t allow a user to log in with Adblock, I tried using the www.antiblock.org script but it only works on one page, on another page where I work with browsing without refresh using ajax it blocks the main div and sometimes the whole site even with Adblock turned off, someone ai already used this script or already had this problem?

NOTE: the site works with "ad exchange"(more or less so), I do not like abusive websites and that block adlock so I never used this script and do not know, but in case I need to block Adblock :D

  • 11

    Note: this is just an opinion, and it has nothing to do with the technical content of the question, OK? : ) I find it curious how this ad scheme works. The developer forces an ad down the throat of the user because it needs the money, and the user looks for ways to block them because they are simply boring. Then the developer looks for ways to block the lock, and eventually the user will look for ways to block the lock... rs Surely there are better ways to earn your deserved money. If users are blocking their ads, there is something very wrong with them.

  • 1

    @Luizvieira, I don’t work with developing open-source solutions that need ads, so I’m not sure how this world turns. But the user will not use Adblock because of the unique and exclusive reason of my ads, he is using by tired of ads all over the web sites that abuse this feature, so regardless of the way my ads are presented, they will be blocked!

  • 3

    @Fernando Yes, of course, but is that my placement was generic and I wanted to say that this advertising model (via popup or before presenting the content) is simply bizarre. There are better ways to display ads, but this is a discussion pro [chat] and not to be done here. :)

  • 1

    @Fernando just an opinionated note, is the following I have a site, the ads are not invasive and do not disturb, but the user has already passed some similar experience on other sites, ready it blocks all sites and I am harmed, so I see so, I put an anti-ab on my website, the guy is obliged to put me on Whitelist and after browsing a little he realizes that the advertisements on my site are not abusive... Another site does the same as me, but the advertisements are abusive, so simply the user will not return there. I think at this point the anti-ab is great...

  • 3

    @Fernando ... That is if the guy uses an anti-ad and has a site "pig" he will end up paying for it. I am totally in favor of advertisements, as long as they do not disrupt navigation or invade the screen and/ or basic features.

  • @Luizvieira read my comments above.

  • @Guilhermenascimento Okay, but if the advertisements on a website are not abusive, why the hell would he need an anti-blockade? Perhaps our concept of "abusive" is not the same. : ) In any event, I stress that this matter should not be discussed here in the comments.

  • @Luizvieira see, I provide a free content, my only source of income to maintain the site are ads, detect such blocks is essential for me to maintain my business, do not agree?

  • I agree with @Fernandoleal. Much as Luizvieira’s opinion makes sense Adblock is installed globally in the browser for all sites. To work in a way that caters to developers who display ads in a way that doesn’t irritate the user, the ideal would be for Adblock to ask if the user wants to block ads from the site they are visiting.

Show 4 more comments

3 answers

17

There is no technical solution that can override a technique that is active with browser privileges. There are some palliatives that usually bring more problems than solutions.

The most one can do is detect that advertising has been blocked and make some decision. Even this is not universal, can stop working and is not considered very suitable. In fact there are already blockers that do not allow scripts from the page to detect whether or not the advertising was displayed. It is even possible to block some action that prevents a content from being displayed because the advertisement has been removed. Already has blocker, not yet "commercial" that prevents the answer accepted and duplicate.

The user has the right to block what he does not want to see, as well as he can do in other media. Forcing it, especially at a time when telephone operators want to impose traffic limits, is unethical and perhaps even legal intervention if it does.

The recommendation is to do nothing. Like all protection, there is always a way to circumvent, and the mechanism ends up causing problems for everyone, including those who accept advertising. When someone thinks they have found a definitive solution, much more quickly than they have invented this solution, they find one that ends the protection. It’s silly to want to make protections in a digital environment where third parties have access to the whole context where it is being executed.

My suggestion is to make advertising an integral part of the content, so it is difficult to block. But nobody wants to do this because it is difficult. Want to make easy money with advertising? Accept that it will be easily blocked. Or look for another template that doesn’t depend on the most active users who don’t accept this.

16


There is no 100% technique, but there are some recommended:

Checking the size of an element

function detectAddNotLoaded() {
    if ($('.foo_dd').height() == 0) {
        // Aqui vc toma a decisão. Mostrar um aviso, redirecionar, etc...
    }
}

$(document).ready(function(){
    detectAddNotLoaded();
});


<div class="foo_dd"><script>
//aqui deve mostrar um banner, mas o adblock bloqueia.
//A ideia é verificar a altura. Se for ZERO, possivelmente não foi carregado devido ao adblock
</script></div>

<div class="foo_dd"><script>
//aqui deve mostrar um outro banner
</script></div>

Against: A user without Adblock enters the page and the banners may not load for any failure or may take time to load.

The advantage over the next example is that it becomes more consistent against more sophisticated blockers that do not block files by naming (ads.js, Advertisement.js, etc)

Loading a blocked file

The technique is to load a url whose name is blocked by the blockers.

The logic is, the ajax request will fail because the blocker will prevent you from accessing "/js/ads.js".

   $.ajax({
            url: "/js/ads.js",
            dataType: "script"
        })
        .fail(function () {
           // Aqui vc toma a decisão. Mostrar um aviso, redirecionar, etc...
        });

The ads.js file may be empty.

Usually blockers try to block everything that is named as ads.js, Advertisement.js, and related names. So, the logic is this.

Against: The ajax request may fail for N reasons. Think of the user who has no blocker and then happen ajax fails.

Considerations

For both examples, points against present a small probability of combinations.

The above examples are not definitive solutions, nor do they have this claim. Be aware that there are other ways to resolve (read "get as close to desirable as possible"). Blockers change algorithms periodically to fit the market as advertisements also fit the market and seek to protect themselves from blockers. It is a constant "war".

Finally, which decision to make depends on each case.

Evaluate the pros and cons for your case.

  • 1

    Perfect, worked perfectly. Thank you.

  • 1

    Great answer, very creative

12

If your site lives on ads and does not want to allow access without them, you must first create a usage policy and inform the user.

I’ve seen some sites that show a popup asking you to accept as a contract saying that you will not block the popups from that site. You may explicitly suggest that the user add the site as an exception in Adblocker.

In general, as @Maniero said, it’s not very nice to block users simply by using Adblocker. For example, if a news site does this to me I simply go to another site.

However, if the content you provide is something more specific and unique, it may not be such a big problem, after all users will want to accept anyway.

Finally, consider that propaganda gives money if there is volume. Maybe it doesn’t make up for the trouble of blocking Adblocker simply because you won’t make money by forcing some people to watch the advertisements. It is better to invest in making the site better, faster, friendly, useful and relevant and so attract more people who besides seeing will click on the links.

In practice, you can use Adblocker detection techniques as in Daniel’s response and perform some action to not let the user see the page. But like I said, it’s gonna take work.

One way is to load all the content via AJAX. First you load the advertisements and only then the normal content. If the first fails, you show some warning to the user.

  • 4

    I think to inform the user and ask him to include the site on Whitelist blocker is the friendliest way to solve this.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.