Hi, great module by the way!

I just wondered whether it would be possible to have a field that a site admin could add certain IP addresses to, which would mean that visitors from those IPs wouldn't be shown Adsense ads? This would ideally be in addition to the current blocking of ads for admins - keeping the IP blocking completely optional for webmasters using the adsense.module.

Or perhaps, if that would mean too much messing around with the database, it could check a text file sitting in the adsense module directory which I could add 2 IPs to?

I'd like to enter my static home and work IPs, so that logged in or not, I won't be shown any ads (and neither will my workmates) - potentially avoiding any accidental clicks from machines which Google associates with me.

Basically a feature which I think Google should introduce to their Adsense program anyway, but as they haven't yet, I thought I'd check with you guys to see if its possbile to implement via this module?

Thanks

Comments

kbahey’s picture

Status: Active » Closed (won't fix)

If you want just certain users to not be shown ads, then there is a permission called "hide adsense".

Admin automatically has that permission. However, you can create a role (say, "paying users", or "buddies", or ..etc) and then assign that permission to them, and they will not see ads at all.

So, all you need to do is to add your buddies to that new role, and they will not see ads.

mediafrenzy’s picture

Yeah that was my first plan, but I soon realised that not everyone has an account at work/home etc, or may simply not be logged in when they decide to absent mindedly browse through my sites.

I'm sure others would benefit from the knowledge of how to set this kind of thing up? Its an all too common question on webmaster forums, how to block adsense from specific IPs. I don't mean to sound pushy - it's just something I think would be a very helpful feature in addition to the many already found in the module :)

Would it be technically difficult to implement for static IPs?

clashar’s picture

Version: 4.6.x-1.x-dev » 7.x-1.x-dev
Status: Closed (won't fix) » Active

Firstly, sorry for opening issue.

Would it be possible to implement IP blocking feature for D7?

I can't block access to web-site totally for some IP, but I just need to not show ads for some IP.

For example on my workplace there are my colleagues who could accidentally click on ad.

I need this feature for any role, including anonymous, so role assigning would not work.

I do believe many others also need this feature.

jcnventura’s picture

Status: Active » Postponed

With NATs, and mobile phones all over the place, this seems more effort to achieve than the payback.

The _adsense_check_if_enabled() function in adsense.module can easily be extended to compare the current IP with the an array of denied IPs and to not display the ad when appropriate.

However, there's no plans in the short term to develop such a feature.

jcnventura’s picture

Component: Code » Wishlist
jcnventura’s picture

Issue summary: View changes
Status: Postponed » Closed (won't fix)

I've decided that this is clearly a 'visibility' setting, and as such as long as you use blocks to set your ads, there are modules that can extend the block visibility to perform this.

This module should not attempt to do anything more than dealing with ads.