how to block specfic ip from seeing ads ?

Discussion in 'AdSense' started by Mido, Mar 23, 2006.

  1. #1
    hello
    once i forgot and opened my adsense account from a net cafe belongs to my friend then i noticed that they are(my friends) checking one of my sites that contain ads so i am afraid they clicking on the ads then google will consider these clicks from me , i want to block appearing ads in this net cafe is that possible ?
     
    Mido, Mar 23, 2006 IP
  2. Kasparoff

    Kasparoff Peon

    Messages:
    335
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you can't do that. And that's the problem with the current version of AdSense software.
     
    Kasparoff, Mar 23, 2006 IP
  3. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you are serving pages dynamically you would do it there. With a php generated page, just replace the start of the AdSense code section with the following:

    
    <?php
    $AdSenseTest =    "pub-xxxxxxxxxxxxxxxx";
    $AdSenseAccount = "pub-1234567891234567";
    $callingIP = $_SERVER["REMOTE_ADDR"];
    $myIP = "127.0.0.1";
    
    if(ereg( $myIP, $callingIP)) { $AdSenseAccount = $AdSenseTest; }
    ?>
    
    <script type="text/javascript"><!--
    google_ad_client = "<?php echo $AdSenseAccount;?>";
    
    Code (markup):
    This way you see an ad block but it is a public service announcement, which is not tied into your account.
     
    clancey, Mar 23, 2006 IP
  4. Sarangan

    Sarangan Well-Known Member

    Messages:
    127
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #4
    If it is a website that runs in php then your lucky.
    Here is the script I am using..

    Add this script on the header..
    <?php
    $AdSenseTest = "";
    $AdSenseAccount = "pub-xxxxxxxxyouridxx";
    $callingIP = $_SERVER["REMOTE_ADDR"];
    $myIP = "xx.xx.your.xx.ip";

    if(ereg( $myIP, $callingIP)) { $AdSenseAccount = $AdSenseTest; }
    ?>

    This the code you have to put in adsense client_id:
    <?php echo $AdSenseAccount; ?>

    Enjoy. :)
     
    Sarangan, Mar 23, 2006 IP
  5. chiefwiggum

    chiefwiggum Peon

    Messages:
    103
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Bad idea to mess with AdSense code, bad idea!!!
     
    chiefwiggum, Mar 24, 2006 IP
  6. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #6
    i will never edit adsense code man but i dont know if these codes should be added to the ad code or where ecactly mayebe some explain for beginners like me will be useful

    also a question about dynamic ip i mean that the internet cafe i talked about before has dynamic ip's so when they restart the router they have new ip's for each pc,dont tell me that i must block the isp ip because its a huge isp here and if i did this i will block huge no of people not only this internet cafe :D
     
    Mido, Mar 24, 2006 IP
  7. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #7
    LOL what?

    How will google tell? They will hack into his server and be like OMFG you replaced my code with a php variable! OH NO

    The HTML output will be the same still.... your banning users you dont want seeing ads, whats the prob? You arent altering googles code.. the HTML is still the same!
     
    Seiya, Mar 24, 2006 IP
  8. MediaHustler

    MediaHustler Well-Known Member

    Messages:
    1,857
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    120
    #8
    Well in the TOS it clearly says don't mess with the ad codes, and they hire people just to check adsense codes on sites.
     
    MediaHustler, Mar 24, 2006 IP
  9. Seiya

    Seiya Peon

    Messages:
    4,666
    Likes Received:
    404
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You fail to see my point... the code will be no differnet than copied and pasted from the adsense panel.. you can change the pub id as much as you want btw and have test ads as much as u want as well :) the adsense code in itself wont be edited because php is insterting a variable based on an if statement
     
    Seiya, Mar 24, 2006 IP
  10. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Yes, you can show/hide your adsense based on the user's IP address, that's not a problem. But, does your friend's internet cafe have a static IP? I doubt it.
     
    exam, Mar 24, 2006 IP
  11. Juan G

    Juan G Peon

    Messages:
    174
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #11
    This has been discussed already, for example on this thread. If there is a good reason, possibly it's better to avoid displaying ads on specific computers (yours, at home, etc.), rather than for ip numbers.
     
    Juan G, Mar 25, 2006 IP
  12. clancey

    clancey Peon

    Messages:
    1,099
    Likes Received:
    63
    Best Answers:
    0
    Trophy Points:
    0
    #12
    This purely a matter of preference. Using the host files on your home computer to block AdSense on our sites, blocks AdSense on all sites.

    This is a good approach if you want to block this type of advertising in general. This is why ad-blocking software will soon block AdSense.

    But, if you want to see AdSense on other people's machines but not on your site, then you will need to find some other method of blocking AdSense. The only one which will work is an IP -based block. You either put your AdSense account info in a variable and dynamically reset that, or you just do not print out out the AdSense javascript if someone one a banned IP visits.

    This does not work if you regularly visit tyour website from numerous computers, Internet Cafes or wireless hotspots around the world.

    In that case, you simply need to show restraint. Do not click on AdSense ads on your site.

    If none of this works for you and you cannot resist clicking on your own ads, then stop running AdSense ads before Google bans you.

    I do not know what more can be said about this. Pick one and stick with it:

    1 - Never click on your ads
    2 - Choose a non-display method that works for you
    3 - Immediately stop using AdSense on your site
     
    clancey, Mar 26, 2006 IP
  13. devin

    devin Guest

    Messages:
    4,461
    Likes Received:
    449
    Best Answers:
    0
    Trophy Points:
    0
    #13
    i don't get why it's so difficult not to click on your own ads. i mean, if you're using a laptop, i understand....................
     
    devin, Mar 26, 2006 IP
  14. livingfree

    livingfree Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    when you're talking about clicking on your own ads, are you talking about lots of them or even just one of them?

    Occasionally an ad might come up that looks interesting or you might want to see what exactly is being delivered - should you not click any at all?
     
    livingfree, Mar 27, 2006 IP
  15. mdvaldosta

    mdvaldosta Peon

    Messages:
    4,079
    Likes Received:
    362
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Never click your own ads. An accidental click isn't going to get you booted, but if you do it on more than a few occassions you will find yourself slapped in the face with a ban stick.
     
    mdvaldosta, Mar 27, 2006 IP
  16. dfsweb

    dfsweb Active Member

    Messages:
    1,587
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    88
    #16
    In short, NO!!

    If you are really keen on viewing that website, just hover over the ad (WITHOUT CLICKING) and you will be able to see the website's URL in the status bar (bottom left). Then, just type that address into explorer and go to the site directly. This way you can go to the "interesting site" without clicking on the ad. Whatever you do, never click on your own ads unless you want to risk getting banned.
     
    dfsweb, Mar 27, 2006 IP
  17. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #17
    ip is dynamic as i mentioned before so i think its hard now to solve this case
     
    Mido, Mar 27, 2006 IP
  18. Fret-Less

    Fret-Less Active Member

    Messages:
    427
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    68
    #18
    I wonder how many people with great sites, great content and the potential for making many tens of thousands of dollars a year, ruin everything by clicking on their own ads?
     
    Fret-Less, Mar 27, 2006 IP
  19. Jenstar

    Jenstar Active Member

    Messages:
    524
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    68
    #19
    Clicking on any ads that are associated with your account... even if you are genuinely interested in what is being advertised... is against the terms and is a suspendable offense.

    From the policies:

    Please note that clicking on your own ads for any reason is prohibited, to avoid potential inflation of advertiser costs.

    And back to the original IP blocking question, if you serve ads through phpadsnew, it does have IP blocking capabilities, and you won't be changing the AdSense script in any way to do so.
     
    Jenstar, Mar 27, 2006 IP
  20. Juan G

    Juan G Peon

    Messages:
    174
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #20
    No, it's very easy, given that surely you can obtain permission to add a simple line to a file on those computers:

    Did you read the linked thread, about "hosts" files, etc.? :rolleyes:
     
    Juan G, Mar 28, 2006 IP