Results 1 to 9 of 9
  1. #1
    TravG's Avatar
    TravG is offline Private Member
    Join Date
    September 2008
    Posts
    2,050
    Thanks
    34
    Thanked 177 Times in 129 Posts

    Default How to Geo Target a State

    I want my website to display a popup if a visitor comes from a certain state. For example, I am promoting Caesars for New Jersey, so if a visitor from New Jersey comes to my website, I would like a popup to come up saying to check out Caesars and a certain page I have which lists New Jersey legal casinos.

    I know this can be done because I have seen other websites do it. In particular if I would click on a casino that does not allow USA players, since I am in the US a popup would come up and say to see their USA casinos.

    Anyone know how to do this? I searched Google but all I can really find is how to do things like this using Adwords. I am not using Adwords, I just want to do it for general search visitors.

    Thanks - Travis
    Live Casino USA - the best USA live online casinos. Play USA online slots and other casino games like USA online blackjack. Like poker? See www.usalegalpoker.com for the best USA poker sites and USA online casinos for the best USA online casino. https://mobileslotslisting.com
    www.usalegalslots.com - www.playusaonlinepoker.com - www.4deucespoker.com

  2. #2
    DaftDog's Avatar
    DaftDog is offline Private Member
    Join Date
    October 2008
    Posts
    1,933
    Thanks
    570
    Thanked 674 Times in 393 Posts

    Default

    Flytonic has just released a new version of their Geo-targeting plug-in. Apparently you can use it to Geo-target down to city level. If you're using WordPress.

  3. #3
    dfiocch's Avatar
    dfiocch is offline Private Member
    Join Date
    September 2006
    Posts
    878
    Thanks
    789
    Thanked 567 Times in 350 Posts

    Default

    You can use some php...
    In particular, you can use this "plugin" from MaxMind

    https://www.maxmind.com/en/geoip2-city

    A quick set-up I have in mind, it works

    < ? php
    include("geoip/geoipregionvars.php"); <--- (you need this snipped for region/states targets, I have one self-wrote for my needs. It works).
    include_once("geoip/geoip.inc"); (in the package from MaxMind)
    include_once("geoip/geoipcity.inc"); (same as above)
    $ip = $_SERVER["REMOTE_ADDR"]; (ip of the visitor)
    $gi = geoip_open("geoip/GeoIP.dat",GEOIP_MEMORY_CACHE); (open the GeoIP database)
    $gs = geoip_open("geoip/GeoIPCity.dat",GEOIP_MEMORY_CACHE); (open the GeoIPCity database)

    $record = geoip_record_by_addr($gs,"$ip"); (this outputs the record by address)
    $regcode =$record->region; (this outputs the state/region CODE, ie NJ)
    $regname = $GEOIP_REGION_NAME[$record->country_code][$record->region]; (this outputs the region/state name, ie NEW JERSEY)
    $countrycode = geoip_country_code_by_addr($gi, "$ip"); (this outputs the country code, ie US)
    $countryname = geoip_country_name_by_addr($gi, "$ip"); (and this the country name, ie UNITED STATES)
    geoip_close($gi); (close all connection to geoip databases, always!)
    geoip_close($gs); (same as above)
    ?>
    Then, you can do something similar. Assuming you want to show something to New Jersey visitors, do this:

    < ? php if ($regcode == NJ) {

    echo 'Hey dude from '.$regname.', how are you?';

    }else{

    echo 'Dude from '.$regname.' this is not for you';
    }

    ? >

    This will outputs:
    <!--?php if($regcode == NJ) {
    < ? php if ($regcode == NJ) {
    echo 'Hey dude from '.$regname.', how are you?';

    } else {

    echo 'Dude from '.$regname.', this is not for you;
    }
    ?;>

    This will outputs (if IP matches the NJ area) ---> - If IP matches NJ area ----> "Hey dude from NEW JERSEY, how are you?"
    - If no matches (IP not matches the NJ area) ---> "Dude from NEW JERSEY, this is not for you"

    Just a quick example


    EDIT: the board won't accept the whole code...
    Last edited by dfiocch; 30 January 2015 at 12:31 pm.

  4. The Following User Says Thank You to dfiocch For This Useful Post:


  5. #4
    Sherlock's Avatar
    Sherlock is offline Public Member
    Join Date
    December 2013
    Location
    WC
    Posts
    4,306
    Thanks
    1,284
    Thanked 3,363 Times in 1,879 Posts

    Default

    Well, you do not say what is your website (plain code or cms) and if your server is under your control or not.

    Best solution is to do the geo check on server level for example with the maxmind database. Then the server will tell you the code of teh state and that code must be implemented into the popup code.
    We are all bloodsucking ticks, hungry, devious
    each one latched on to the ass of the previous
    when the last and the first latch on it can be shown
    ass-blood sucked by the first from the last is his own

  6. The Following User Says Thank You to Sherlock For This Useful Post:

    dfiocch (30 January 2015)

  7. #5
    TheGooner's Avatar
    TheGooner is online now Private Member
    Join Date
    March 2007
    Location
    New Zealand
    Posts
    4,298
    Thanks
    1,968
    Thanked 4,255 Times in 2,024 Posts

  8. The Following User Says Thank You to TheGooner For This Useful Post:

    dfiocch (30 January 2015)

  9. #6
    TravG's Avatar
    TravG is offline Private Member
    Join Date
    September 2008
    Posts
    2,050
    Thanks
    34
    Thanked 177 Times in 129 Posts

    Default

    So it looks like you have buy that plug-in, which isnt a big deal but I need to get a better understanding of this first. What you guys are saying above is pretty much Greek to me.

    My website is plain code and I do not have much access to the server. Guess ill Google MaxMind Database next - ha! I am starting to get a better handle on the server side and technical aspects of running a website but I still have a lot to learn.
    Live Casino USA - the best USA live online casinos. Play USA online slots and other casino games like USA online blackjack. Like poker? See www.usalegalpoker.com for the best USA poker sites and USA online casinos for the best USA online casino. https://mobileslotslisting.com
    www.usalegalslots.com - www.playusaonlinepoker.com - www.4deucespoker.com

  10. #7
    MichaelCorfman's Avatar
    MichaelCorfman is offline GPWA Executive Director
    Join Date
    June 2004
    Location
    Newton, MA
    Posts
    4,277
    Thanks
    915
    Thanked 5,540 Times in 1,785 Posts

    Default

    The maxmind database, together with custom code, is what we use on the online.casinocity.com website. We complement that with a database of currency by geographic location that we put together ourselves, and also with the visitor's browser language preference, to make default decisions about which information to show a visitor to the site. We show the user the preferences we have made on that basis in the upper left corner of our web pages, and let them modify those preferences if they wish.

    Michael
    GPWA Executive Director, Casino City CEO, Friend to the Village Idiot

    Resources for Affiliates: iGamingDirectory.com, iGamingAffiliatePrograms.com, GamingMeets.com

  11. #8
    Sherlock's Avatar
    Sherlock is offline Public Member
    Join Date
    December 2013
    Location
    WC
    Posts
    4,306
    Thanks
    1,284
    Thanked 3,363 Times in 1,879 Posts

    Default

    Well it is hard to tell what is and what is not effective to learn. It depends also on your other knowledge and parts of world where you are expert and on your budget as well. If you are very good in other areas and you have a lot of money, then simply hire someone who will know what to do and all you need is the formula, how to pick up the right guy(s) [which is maybe the hardest skill ever and big mystery].They will handle this cheap issue and other IT problems as well.

    Then you need to know at least roughly what you need.

    In your case you need 1-2 guys:
    1. serveradmin who will enable geoip at apache (maybe if you write to your hosting, they will do it, depends on your server, how much you pay them etc)
    2. javascript coder, who will enable the popunder code that he will download from github or something like that and connect it to the proxy coming from the server geoip mode

    It is possible that one guy, just the programmer, can do it. I think he has to know except javascript also basics of php. The php can handle the geoip as well. In that case the maxmind database is put directly into your own database on server. This solution is better in a way that just one guy can do it. But it is worse in terms of server performance and Occam's razor (which is not a problem if your traffic does not fill the server capacity).

    It is just my impression (or maybe my own lazyness), but to learn this by onseself it is not an easy task. It is at least 2 new systems (javascript+php or javascript+apache), certainly a lot of time will be spent before a newbie knows how to do it (although what you need is a trivial task for insider). But maybe it is your fancy and learning by doing.... in that case, go for it! Learn how to put maxmind into your own database, learn how to do the geo IP based on that database [end of php part] and then download the popup code on your own and even without understanding it, try to connect it. In few days or weeks it will be done and probably it will have many major bugs taht will cost you a lot of money, but Rome was not build in one day.

    But if you just need the work to be done and you do not plan to be your own coder, then I suggest you going to odesk, ask for this to be done by a freelancer. It is a work for 2-5 hours, so if you formulate the problem well, it should cost you just pennies.

    If you want to go though the easy way, I suggest to hire programmer to whom you will tell exactly the same request as you wrote in post nr.1 here. If he does not make the work, fire him and repeat. Stay i touch with the one who will understand and do the job, because you formulated it quite well and after all it is freelancer's job to understand you and not you to them.
    We are all bloodsucking ticks, hungry, devious
    each one latched on to the ass of the previous
    when the last and the first latch on it can be shown
    ass-blood sucked by the first from the last is his own

  12. The Following User Says Thank You to Sherlock For This Useful Post:


  13. #9
    TravG's Avatar
    TravG is offline Private Member
    Join Date
    September 2008
    Posts
    2,050
    Thanks
    34
    Thanked 177 Times in 129 Posts

    Default

    Nice.Yes I think hiring a freelancer will be the way to go. While I like to learn new things, like you say my time can be much better utilized elsewhere. I will check out odesk.

    Thanks!

    Quote Originally Posted by Sherlock View Post
    Well it is hard to tell what is and what is not effective to learn. It depends also on your other knowledge and parts of world where you are expert and on your budget as well. If you are very good in other areas and you have a lot of money, then simply hire someone who will know what to do and all you need is the formula, how to pick up the right guy(s) [which is maybe the hardest skill ever and big mystery].They will handle this cheap issue and other IT problems as well.

    Then you need to know at least roughly what you need.

    In your case you need 1-2 guys:
    1. serveradmin who will enable geoip at apache (maybe if you write to your hosting, they will do it, depends on your server, how much you pay them etc)
    2. javascript coder, who will enable the popunder code that he will download from github or something like that and connect it to the proxy coming from the server geoip mode

    It is possible that one guy, just the programmer, can do it. I think he has to know except javascript also basics of php. The php can handle the geoip as well. In that case the maxmind database is put directly into your own database on server. This solution is better in a way that just one guy can do it. But it is worse in terms of server performance and Occam's razor (which is not a problem if your traffic does not fill the server capacity).

    It is just my impression (or maybe my own lazyness), but to learn this by onseself it is not an easy task. It is at least 2 new systems (javascript+php or javascript+apache), certainly a lot of time will be spent before a newbie knows how to do it (although what you need is a trivial task for insider). But maybe it is your fancy and learning by doing.... in that case, go for it! Learn how to put maxmind into your own database, learn how to do the geo IP based on that database [end of php part] and then download the popup code on your own and even without understanding it, try to connect it. In few days or weeks it will be done and probably it will have many major bugs taht will cost you a lot of money, but Rome was not build in one day.

    But if you just need the work to be done and you do not plan to be your own coder, then I suggest you going to odesk, ask for this to be done by a freelancer. It is a work for 2-5 hours, so if you formulate the problem well, it should cost you just pennies.

    If you want to go though the easy way, I suggest to hire programmer to whom you will tell exactly the same request as you wrote in post nr.1 here. If he does not make the work, fire him and repeat. Stay i touch with the one who will understand and do the job, because you formulated it quite well and after all it is freelancer's job to understand you and not you to them.
    Live Casino USA - the best USA live online casinos. Play USA online slots and other casino games like USA online blackjack. Like poker? See www.usalegalpoker.com for the best USA poker sites and USA online casinos for the best USA online casino. https://mobileslotslisting.com
    www.usalegalslots.com - www.playusaonlinepoker.com - www.4deucespoker.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •