Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Detect Adblock Plus?

Detect Adblock Plus?

While I don't plan on having many ads at all, I still want to be able serve other content instead of my planned ad if adblock plus is detected on a user's browser.

Thanks

BeTheDance
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Detect Adblock Plus?

What's adblock plus? A browser extension? In order to be able to switch modules etc you would need to have some way of detecting this, from the web server end.

Do you know if there's any way of doing this? Does adblock plus perhaps announce itself in the User Agent string or something like that?

If it remains invisible then it's going to be very hard to detect, in order to provide alternative content.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: Detect Adblock Plus?

Hi,

Adblock Plus is THE most downloaded add-on for Firefox and I think there is an IE version as well.

It removes any advertising from displaying on the page. http://adblockplus.org/en/

Now, I get that users should have the ability to block annoying ads, but that's not me.

If I decide to include a few ads and IF they are of the type that gets blocked by Adblock, then I want to display some other appropriate content.

It's definitely detectable (although I don't know how it's technically done), because there are some scripts that do it. There is one Joomla plugin for it, but it doesn't do what I really want, which is the more granular control that MetaMod provides. http://extensions.joomla.org/extensions … ards/12598

Thanks for your consideration.

BeTheDance
Beginner Modder
ranks
useravatar
Offline
9 Posts
Administrator has disabled public posting

Re: Detect Adblock Plus?

Hi,

I've had a look at some code suggested on the net for detecting adblock plus. It's along the lines of creating a javascript file that Adblock Plus would block. In that file there is a snippet of JS that hides the alternative content on screen.

I have deliberately avoided putting code into MetaMod that displays things to the end user apart from modules themselves, e.g. by adding JS code etc. I'm still not very keen to do it at this stage for architectural reasons, though I can see why you would want the ability to do this.

Anyway, the Joomla extension you linked to almost certainly does this.

What I'd suggest trying is this. You'll need to do some work with it, but I think you could get it to work:

1 - create a new module position perhaps just above or below the position that has your ad in it. This will contain your alternative content modules.
2- around the module position place a div with class="ffix"
3 - assign your "alternative content" module(s) to the new module position
4 - use a MetaMod to control whether/when the new modules appear or not
5 - create a file and save it in the root web folder of your joomla install. It should be accessible at the URL "http://www.mydomain.com/advertisement.js". Give it the following content:

Code:

document.write('<style type="text/css">.ffix {display:none!important;}</style>');

6 - add this to the head of your template:

Code:

<script src='http://www.mydomain.com/advertisement.js' type='text/javascript'/>

7 - that's it.

I haven't tested it but I hope this will at least get you started. Please write back to let us know how you get on!

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1667
Total Polls:
6
Total Posts:
5909
Posts this week:
1
User Info:
 
Total Users:
10137
Newest User:
lexispoker1
Members Online:
1
Guests Online:
185

Online: 
liaskas

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked