How to implement Geolocation / Geo-Targeted banner ad display on my web site?

Posted on 2011-05-06
Last Modified: 2012-05-11
I'm looking for a solution either in perl or php to dynamically display geo-targeted ads based on user's IP.  I don't need a complete banner system, but ways for me to make customized implementation.

Is there any cost involved to determine user's location based on IP?


If user is located in Japan, I'll display local Japanese ads.

If in China and Hong Kong, I'll will display local Chinese ads.

Users from the rest of the world, I'll display English ads targeted globally.

I don't want to determine based on browser's language detection, but based on user's physically location and IP address.
Question by:jay28lee
    LVL 48

    Expert Comment

    Do you want to have control over the actual ads or not?

    If not, then have you considered Google Adsense?

    Author Comment

    yes, i want to have full control of the ads on what exactly is being displayed.
    LVL 82

    Accepted Solution

    Maxmind has some free version of their GeoIP code available.  Get the API and code that you can use.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to dynamically set the form action using jQuery.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now