1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to hide adsense ads for a specific country?

Discussion in 'PHP' started by KingCobra, Mar 4, 2013.

  1. #1
    My web site is based on PHP-MySQL.
    I have adsense ads in my site.
    I would like to hide adsense ads for the visitors of a specific country (Example: Nepal). So when the visitors of Nepal visit my site they will not see adsense ads on my site.
    Other visitors from other countries will see the ads normally.

    Is it possible? Please tell me the ways. Thank you.
    KingCobra, Mar 4, 2013 IP
  2. J.P

    J.P Well-Known Member

    Messages:
    766
    Likes Received:
    42
    Best Answers:
    3
    Trophy Points:
    155
    #2
    You could always have a php script that checks IP address against a list of known IP addresses (from the specific countries) and store the result.. then just put the ads in a if statement to allow or block depending on IP.. just a quick and random thought
    J.P, Mar 4, 2013 IP
  3. ogah

    ogah Greenhorn

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    you need ip to country script.
    you can use maxmind or ip2location API
    ogah, Mar 4, 2013 IP