Forum Moderators: martinibuster

Message Too Old, No Replies

Prevent Some IP for clicking

         

chapran

7:47 pm on May 12, 2005 (gmt 0)

10+ Year Member



I couldn't find in help how could I prevent some visitors to click on AdSense. If I know the IP (for instance my own IP) how can I make it not work with AdSense?

Thank you
Vlad

arrowman

9:37 pm on May 12, 2005 (gmt 0)

10+ Year Member



[webmasterworld.com...] (10th post)

chapran

9:50 pm on May 12, 2005 (gmt 0)

10+ Year Member



I've read the part of this discussion related to IP, but still do not know where I can switch On and Off certain IP. Could anybody give some more clear instructions please

Thank you
Vlad

Galtego

9:59 pm on May 12, 2005 (gmt 0)

10+ Year Member



Under Apache, using conditional SSI, you can do something like this:

<!--#if expr="${REMOTE_ADDR} = /11.111.111.11/" -->
<!--#elif expr="${REMOTE_ADDR} = /22.222.222.22/" -->
<!--#elif expr="${REMOTE_ADDR} = /33.333.333.33/" -->
<!--#else -->
AdSense Code
<!--#endif -->

This is the basic idea that you'll need to research depending on your server: not even showing the ads to certain IPs. It is not something Google offers. You'll need to learn how to do it on your site.

arrowman

11:55 am on May 13, 2005 (gmt 0)

10+ Year Member



Could anybody give some more clear instructions please

It depends on what server-side programming/templating language you use. SSI? PHP? ASP? JSP? CGI/Perl? A CMS?

chapran

3:31 pm on May 13, 2005 (gmt 0)

10+ Year Member



I'm using ASP.

Thank you
Vlad

Timotheos

4:27 pm on May 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not an expert at ASP but this works. If the visitor is not a certain IP address then show the ads.

<% if Request.ServerVariables("REMOTE_ADDR") <> "111.111.111.111" then %>

Google Adsense Code goes here.

<% end if %>

arrowman

7:00 pm on May 13, 2005 (gmt 0)

10+ Year Member



In that case, Google for a page titled "ASP - How to block IP address in a guestbook?"

I guess it's against the TOS to post the URL, but you'll find it.