“mobile”/ adcombo
Dismiss Notice
Welcome to Our Community
Wanting to join the rest of our members? Feel free to sign up today.

How to insert geo location banner?

Discussion in 'General Affiliate Marketing Forum' started by maurosicard, Oct 10, 2014.

  1. maurosicard

    maurosicard Affiliate affiliate

    Hello friends,

    I want to insert some different banners in a WordPress site, but I want to be different banners depending on the country.

    Is there a way to do this? ,

    Thank you very much
  2. terraleads
  3. crysper

    crysper Moderator moderator Service Manager affiliate

    Maybe there are some plugins that will do it much better than this, but I'll give you a code which should work.
    Put this on the header of your page(inside the <head> tag):
    <script src="http://j.maxmind.com/app/geoip.js"></script>

    Put this exactly where the banner should be placed:
    var banner={};
    banner['default']='<a href="banner link when you click on it"><img src="default banner source" /></a>';
    //banner['default'] is the banner for the visitors who are from countries that are not in the banner list below

    banner['US']='<a href="banner link when you click on it"><img src="US banner source" /></a>';
    banner['FR']='<a href="banner link when you click on it"><img src="FR banner source" /></a>';
    //....use the same pattern for the countries you need

    var country_code=geoip_country_code();


    Last edited: Oct 10, 2014

Top Resources