• Blogging
  • Freebies
  • Freeware
  • How-To
  • Make Money Online
  • Mobile
  • Home >> Blogging >> How To Geo-Target Ads based on visitors location

    How To Geo-Target Ads based on visitors location

    Today, I am going to tell how i implemented Geo-Targeting Ads based on visitors country. Let me first explain Why Geo-Target Ads and How you can implement it on your domain/site or your blog.

    How to Geo Target Ads

    There are some advertising networks who only pay if the visitors are from a specific country say USA or Canada. I serve Axill CPM ads and ApplyAds CPM ads. ApplyAds CPM ads pays for impressions only if the visitor is from USA or Canada.

    If i place a ApplyAds leaderboard CPM ad and if the visitor is not from USA or Canada, I will not earn for that Ad space.

    What if i want to serve Axill CPM ads for non-US and non-Canada visitor and ApplyAds CPM ads for US and Canada visitor?

    You could use the same method to Display Chitika Premium Ads only to US Visitors

    Geo-Targeting ads based on visitors location (country,city)

    The below steps provided are only for self-hosted blog and website/domain . You can skip the below and scroll down to find the steps for those who have their blogs on sub domain like a blog on blogspot.com

    Implementing Geo-Target Ads on your domain/site:

    MaxMind provides GeoLite Country database. Download and unpack Maxminds geoip database. It’s free and is updated every month. Using it, you can find out what country a visitor came from based on the IP address. They say it’s 97% accurate.

    1. Download the database and unzip (gunzip -d GeoIP.dat.gz on linux)
    2. Upload the database file to your site.
    3. Now you need API to query the database. MaxMind provides API in multiple languages so that you can use whichever you are comfortable with. Get the GeoIP API

    I used PHP API to implement it on my site. You can pick and use any API with which you are comfortable and your hosting service is compatible.

    The database is pretty big and if a returning visitor visits the site, the API queries the database again. To avoid redundant querying, you can store visitors countryCode in a cookie. This smart tip is provided at this site Geo target your visitors. I am also using it in this site 🙂

    Implementing Geo-Target Ads on your blog hosted on blogspot.com or any other subdomain:

    MaxMind also provides a javascript which is placed on one of their sites. They say the uptime for the Javascript service is about 99.95%. So, you can go ahead and use it without any doubt in mind.

    1. Use GeoIP Javascript Web Service.
    2. Copy the below code just after <body> tag
    3. Place the following code where ever you want ads to appear based on visitors country

    WidgetBucks and ShoppingAds are other advertising networks pay only for country specific visitors/traffic. You can go ahead, use it and see the difference.

    This method will definitely increase revenue.

    Any suggestions or doubts. Leave a comment.

    IMPORTANT: This blog welcomes Guest Bloggers, Writers to also contribute by writing Guest Posts and also Make Money!. Check out our Revenue Sharing Program
    1924 readers are already subscribed to this blog! Why don't you be one of them? Subscribe to this blog via your favorite RSS feed reader or by entering your email address on the form below:


    1. […] has wrote a enthusiastic tutorial on how to geo-target your ads in your locate and decriminalize modify visitors from added countries. Lets verify for warning you […]

    2. […] has wrote a great tutorial on how to geo-target your ads in your locate and monetize even visitors from added countries. Lets take for example you are using […]

    3. […] has wrote a great tutorial on how to geo-target your ads in your locate and monetize even visitors from added countries. Lets take for example you are using […]

    4. Mattias says:

      Glad you liked the idea to use cookies to store the visitors location 🙂


    5. Keith says:

      I find that click-thrus and conversions are increased with geo-targeting

    Leave a Reply

    page counter
    NiharsWorld on Twitter NiharsWorld on Facebook NiharsWorld RSS Feed