Home >
Programming, Servers & Scripts >
Check Your Landers: MaxMind Javascript City Location May Not Work Any More. (44)
07-11-2013 12:25 PM
#1
caurmen (Administrator)
Check Your Landers: MaxMind Javascript City Location May Not Work Any More.
Seems like there's something up at Maxmind (the providers of most peoples' geolocation scripts) at the moment.
They've been changing terms of service left, right and center, and over the last couple of days, I've noticed that the geoip_city() function for the old Maxmind Javascript library isn't working for me. Other Stackers have also mentioned similar problems.
Looking at their website, it seems that they're now requiring payment and registration for the use of the old maxmind Javascript that many of us have been using. There's a Version 2 free script, but it requires users to let your LP access their location, which I'd expect to drop CTRs and CVRs considerably.
If you're using the Maxmind JS on your landers, the simplest solution will probably be to either pay for lookups - $20 for 200,000 lookups - or switching to their PHP library. They charge for their city-based PHP library, and it appears to be on a per-site license too - however, individual country libraries aren't too expensive, at around $50-$100 for a one-time purchase.
I'm going to look into this more as a matter of urgency, as well as looking at alternative, free or cheap ways to detect city now, and I'll report back ASAP.
If you've got any tips or suggestions or if the Maxmind JS is still working for you, please do let me know!
07-11-2013 12:42 PM
#2
ironman (Member)
wtf
* US database is $250 one time fee, and $61 per month of updates.
hurts to pay $$$ for something that was free till now 
07-11-2013 02:15 PM
#3
pain2k (Veteran Member)
All of that $$$ that was made while utilizing their db, I don't think it's a problem to pay for it.
07-11-2013 03:15 PM
#4
twinaxe (Senior Moderator)
I only use their paid service for some long time.
Few years ago I only used their free service, but now I only use their Geo IP City service because there you can also track the ISP for example and I need some more data for other scripts.
But in my opinion it´s more than worth the money.
07-11-2013 04:18 PM
#5
impride (Member)
I see it's still working for me with this code:
<script type="text/javascript" src='http://j.maxmind.com/app/geoip.js'></script>
07-11-2013 04:56 PM
#6
gritz (Member)
I'm surprised so many people use the JS version and not the PHP version. With PHP and P202, you can track conversions by state with &c1=FL... optimizing geos has to be one of the easiest optimization techniques of all, all you gotta do is capture the data! On my PHP install, the variable for the state code is $_SERVER['GEOIP_REGION']. Baked right into the PHP core.
So for example if you have a destination URL of...
HTML Code:
http://yoursite.com/redirect.php?ad_id={ad_id}&keyword={keyword}
..your redirect.php would simply be.
[PHP]
<?php
$ad_id = $_GET['ad_id'];
$state = $_SERVER['GEOIP_REGION']; // love me some geo data
$keyword = $_GET['keyword'];
header("http://yoursite.com/lp.php?t202id=xxxx&c1=$ad_id&c2=$state&t202kw=$key word");
?>
[/PHP]
An example link would look like...
HTML Code:
http://yoursite.com/lp.php?t202id=xxxx&c1=adidnumber&c2=FL&t202kw=hydroxycut
Simple optimizations. You can then bid differently by state, or even turn states off entirely. If you're on an Ubuntu server, you want to install the geoip PHP module. Login to your server as root in the terminal and follow these instructions:
http://abautu.blogspot.com/2011/11/s...tu-server.html
Here's all the geo data you get baked right into PHP
edit: Almost forgot... with this installed, you can also control geo redirects! If your offer only accepts UK traffic, you can send all UK traffic through your affiliate link, and all other traffic to a page on the site that isn't all geo-controlled (a network link will usually redirect to MYLOTTO!! EXIT POP!)
07-11-2013 07:39 PM
#7
hd2010 (Member)
is this for apache, I'm using nginx and php-fpm, but it do have this info, need some echoing, nice tips on narrowing the demo
07-11-2013 08:33 PM
#8
gritz (Member)

Originally Posted by
hd2010
is this for apache, I'm using nginx and php-fpm, but it do have this info, need some echoing, nice tips on narrowing the demo
It doesn't matter if you have Nginx (I do too, Nginx FTW). Once you install a PHP module, you simply have to restart Nginx (or Apache) for the new PHP module to take affect. I do
HTML Code:
service nginx restart
You might also want to restart PHP-FPM with...
HTML Code:
service php5-fpm restart
For Apache, I use...
HTML Code:
service apache2 restart
Not sure what's up with the init.d stuff in online tutorials, I'm pretty new to setting up and managing servers myself.
07-11-2013 11:02 PM
#9
zeno (Administrator)
Most people will be using the PHP version AND the Javascript version for some things. For some there is lack of technical know-how (and hence landers are used as is when ripped or downloaded). Additionally, if I recall rightly the free web service may have had benefits (i.e. extra accuracy and data?) over the free GeoLite city/country databases, so a lot of people opt to use that instead of buying databases. The region/org/country databases aren't particularly expensive but the city one costs nearly $400, so you could just buy it last and use the free GeoLite city until then.
07-12-2013 09:46 AM
#10
caurmen (Administrator)
@impride - are you able to pull city information using that code? I found it was still working for country location, just not for region or city.
07-12-2013 09:59 AM
#11
deedsmedia (Member)
If you making good money, $400 shouldn't be a problem in my eyes. But for the people that want it cheaper you can try this for $199 per year: http://www.ip2location.com/databases...ry-region-city
Just rent you a small server for $5 or $10 bucks, install the geo script there and use it like the JS from MaxMind.
07-12-2013 11:55 AM
#12
impride (Member)

Originally Posted by
caurmen
@impride - are you able to pull city information using that code? I found it was still working for country location, just not for region or city.
Yeah, pulling city info without problems.
07-13-2013 12:18 PM
#13
caurmen (Administrator)
Huh, that's strange. Still, good news for you!
Anyone else finding they're still able to pull city data from the Javascript?
07-13-2013 08:47 PM
#14
dingdong (Member)
City still works for me
07-13-2013 11:21 PM
#15
blucas (AMC Alumnus)
Still pulls for me as well.
07-13-2013 11:36 PM
#16
keepitsimple (Member)
still working
07-14-2013 12:11 AM
#17
tmcalvin (Member)
js city working here
07-14-2013 03:26 AM
#18
hd2010 (Member)

Originally Posted by
gritz
It doesn't matter if you have Nginx (I do too, Nginx FTW). Once you install a PHP module, you simply have to restart Nginx (or Apache) for the new PHP module to take affect. I do
HTML Code:
service nginx restart
You might also want to restart PHP-FPM with...
HTML Code:
service php5-fpm restart
For Apache, I use...
HTML Code:
service apache2 restart
Not sure what's up with the init.d stuff in online tutorials, I'm pretty new to setting up and managing servers myself.
init scripts are used for start/stop or restart your linux services
07-15-2013 09:30 AM
#19
caurmen (Administrator)
OK, good, looks like it's just failing for some people - they may be limiting their services based on server's geographical location or something similar.
Definitely worth keeping an eye on, particularly since they're clearly winding the service down, but no need to panic yet.
I'm still going to look into alternative services so that we've got a backup option ready to roll for when/if things do close down. Look for that later this week.
07-15-2013 03:05 PM
#20
hd2010 (Member)
why not switch to server side solution, it uses your vps/server resources, rather than you hammering the maxmind server
07-15-2013 04:04 PM
#21
tmcalvin (Member)
@caurmen, it might be cool to see a guide on setting this up on your own server and some usage examples.
I do have some issues sometimes when viewing my landers through a proxy where the city doesn't display. I'm using HMA. I don't know if its a deal where it isn't near a larger city or something. Could this be an issue with my proxy? Think it would display for actual viewers?
It would be nice to fallback to the closest available city. It kinda messes up some text when this happens like "9999 members near you in" instead of "9999 members near you in Gotham City". Does anyone know a way to display some alternate text if the city doesn't display?
07-15-2013 04:31 PM
#22
caurmen (Administrator)
@tmcalvin - It's fairly easy to set up an alternative piece of text - I'll add a quick guide to how to do that when I write the geolocation with PHP guide!
07-15-2013 04:41 PM
#23
tmcalvin (Member)

Originally Posted by
caurmen
@tmcalvin - It's fairly easy to set up an alternative piece of text - I'll add a quick guide to how to do that when I write the geolocation with PHP guide!
That would be awesome, thanks caurmen.
Could you also include how to pull surrounding city names? I've seen this done with different profile pic landers, where all the featured members come from nearby cities, not just from the city of the visitor.
07-15-2013 09:57 PM
#24
vaalion (Member)
It seemed to be working for me past few days but it definitely stopped today. I was using the java script version as well... Does it still work for the others that said in the last few days it was working? It definitely was working 24 hours ago or so and not now...
Anyone have a guide on hosting this as a standalone? It would probably make my pages load faster anyway so it would turn out to be a benefit once I take the time to set it up 
07-16-2013 02:15 AM
#25
vaalion (Member)
Anyone know how to use the $20 per 50,000 lookup? That seems the best solution for me right now since php installation seems really complicated, I looked for a few hours and can't make it work 
07-16-2013 02:43 AM
#26
zeno (Administrator)

Originally Posted by
vaalion
Anyone know how to use the $20 per 50,000 lookup? That seems the best solution for me right now since php installation seems really complicated, I looked for a few hours and can't make it work

Who do you have hosting with? Also, if you're willing to pay $20 for 50,000 lookups it makes sense to pay someone to do the PHP installation if the JS web service isn't critical.
07-16-2013 03:15 AM
#27
vaalion (Member)

Originally Posted by
zeno
Who do you have hosting with? Also, if you're willing to pay $20 for 50,000 lookups it makes sense to pay someone to do the PHP installation if the JS web service isn't critical.
I use Beyond hosting. Id use the lookups because I only depend on geolocation on 1/4 of my campaigns, I think that $20 will easily last me 1-2 months. I was hoping that solution is as simple as buying them and making my maxmind account authorize my domain but I dont think its that simple

.
07-16-2013 05:10 AM
#28
zeno (Administrator)

Originally Posted by
tmcalvin
That would be awesome, thanks caurmen.
Could you also include how to pull surrounding city names? I've seen this done with different profile pic landers, where all the featured members come from nearby cities, not just from the city of the visitor.
I think that's harder to do - I believe it involves looking up someones latitude/longitude based on IP, forming a square of some size in lat/long units, then finding cities with lat/long coordinates within those boundaries and subsequently putting them into an array. I don't have the PHP skills to do it though and haven't found a decent guide on the net.

Originally Posted by
vaalion
I use Beyond hosting. Id use the lookups because I only depend on geolocation on 1/4 of my campaigns, I think that $20 will easily last me 1-2 months. I was hoping that solution is as simple as buying them and making my maxmind account authorize my domain but I dont think its that simple

.
Dude just ask BH to do it, you pay for their support so use it. Ask them to install Maxminds C libraries/GeoLite City and Country and the PECL PHP extension then you should be good to go. They have no doubt done this thousands of times so know exactly what you need.
07-16-2013 06:15 AM
#29
tmcalvin (Member)
Thanks for taking a look at that zeno.
I might hire someone to code something up for me. If you want to tinker on it, here's an example of one I've seen recently. I dug around in the code a little but didn't see anything I could make sense of.
http://www.freelifetimefuckbook.com/...zrf2&vid=27J45
07-16-2013 06:27 AM
#30
zeno (Administrator)
If it's done with PHP you can't rip it as the processing is done server-side before it even gets delivered to you (i.e. you just seen the end results not the original instructions).
07-16-2013 12:25 PM
#31
caurmen (Administrator)
Could you also include how to pull surrounding city names? I've seen this done with different profile pic landers, where all the featured members come from nearby cities, not just from the city of the visitor.
I've got a pretty good idea how to do this (Zeno's basic approach is exactly how I'd do it too) - I'll see what I can do about a tutorial. I'd rather like to use this technique myself, so it's definitely worth a look!
(Of course, you could just use Besmir's awesome
Google Maps lander code to do something similar with pins on a map.)
07-16-2013 01:17 PM
#32
vaalion (Member)

Originally Posted by
caurmen
I've got a pretty good idea how to do this (Zeno's basic approach is exactly how I'd do it too) - I'll see what I can do about a tutorial. I'd rather like to use this technique myself, so it's definitely worth a look!
(Of course, you could just use Besmir's awesome
Google Maps lander code to do something similar with pins on a map.)
Ya that would be cool to do. It might work well for big countries like the US.
Thanks a lot Xeno for your help, I got it done now. It sucks to have to change all my LP's but now at least they will be harder to copy and will probably load faster since I don't need to connect to Maxmind's servers which always worried me because if their servers were down one day I would lose a ton of $$$.
This ended up being a good thing since it finally forced me to change it to a local solution and now with inline CSS I don't have to load anything in the <head> section
07-17-2013 05:20 AM
#33
tmcalvin (Member)

Originally Posted by
zeno
I think that's harder to do - I believe it involves looking up someones latitude/longitude based on IP, forming a square of some size in lat/long units, then finding cities with lat/long coordinates within those boundaries and subsequently putting them into an array. I don't have the PHP skills to do it though and haven't found a decent guide on the net.
yea, I spent a decent amount of time tinkering. This is the closest thing I found.
http://www.geoplugin.com/webservices...#nearby_places
It does something similar on the example but I couldn't get it to work how I wanted.

Originally Posted by
zeno
If it's done with PHP you can't rip it as the processing is done server-side before it even gets delivered to you (i.e. you just seen the end results not the original instructions).
Thanks for looking at that zeno, I kinda figured that might be the case. btw, is there any way to look at preprocessed php?

Originally Posted by
caurmen
I've got a pretty good idea how to do this (Zeno's basic approach is exactly how I'd do it too) - I'll see what I can do about a tutorial. I'd rather like to use this technique myself, so it's definitely worth a look!
(Of course, you could just use Besmir's awesome
Google Maps lander code to do something similar with pins on a map.)
that would be sweet caurmen. I've been trying to figure this out for awhile. I know it results in a small detail on the page but I think the small details add up.
yea, besmir's lander is pretty sick, I ended up gutting it and making a few versions of my own from the bones.
07-17-2013 11:14 AM
#34
caurmen (Administrator)
btw, is there any way to look at preprocessed php?
How do you mean? PHP stored in an opcode cache, or something else?
07-17-2013 08:28 PM
#35
janluc (Member)
Does this MaxMind Code still working correctly on all of you?
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var city = geoip_city();
var state = geoip_region();
</script>
<script language="JavaScript">document.write(city);</script>,
<script language="JavaScript">document.write(state);</script>
I was looking at my Landing Pages through HMA Proxies. What I was seeing is that on many of UK and US cities it shows another locations, not those from what I was browsing through HMA.
Also, I am seeing huge CR decrease for about 3 days on all of my campaigns that are using LP's with Maxmind. Could it be due to their changes? Maybe, they have blocked some of the cities to be shown on this free maxmind script?
Also, what tools are you using to understand visitor's experience to see how they interact with your LP's (to see that maxmind working properly etc.) - clicktale's "visitors recordings" or some others? HMA proxy don't give real data on this, so, maybe, you use something else?
Thanks for help!
07-17-2013 08:37 PM
#36
tmcalvin (Member)

Originally Posted by
caurmen
How do you mean? PHP stored in an opcode cache, or something else?
I'm not really sure, I might be making stuff up. I'm really weak with php.
basically what I'm wondering is if you could see the code that is used to get the results, not just the output.
kinda the same way you can look at html & js and see how it works.
I hope that makes sense like it does in my head.
07-17-2013 08:38 PM
#37
tmcalvin (Member)

Originally Posted by
janluc
Does this MaxMind Code still working correctly on all of you?
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var city = geoip_city();
var state = geoip_region();
</script>
<script language="JavaScript">document.write(city);</script>,
<script language="JavaScript">document.write(state);</script>
I was looking at my Landing Pages through HMA Proxies. What I was seeing is that on many of UK and US cities it shows another locations, not those from what I was browsing through HMA.
Also, I am seeing huge CR decrease for about 3 days on all of my campaigns that are using LP's with Maxmind. Could it be due to their changes? Maybe, they have blocked some of the cities to be shown on this free maxmind script?
Also, what tools are you using to understand visitor's experience to see how they interact with your LP's (to see that maxmind working properly etc.) - clicktale's "visitors recordings" or some others? HMA proxy don't give real data on this, so, maybe, you use something else?
Thanks for help!
worked for me
output
Kansas City, MO
07-17-2013 10:58 PM
#38
janluc (Member)
If I set, for example, Dublin, Ireland HMA proxy - it shows nothing. The same happens with many non-US cities, especially in UK.
So, I see few conversions from UK and Ireland - they convert very poor. Can it be due to this? Anybody has some experience with it?
07-17-2013 11:02 PM
#39
tmcalvin (Member)
I see what you're saying. I get that a lot actually. I mentioned it further up the thread. I wasn't sure if it was something to do with the proxy. Caurmen said he would be posting a method for displaying alternate text in a situation like that.
07-18-2013 12:11 AM
#40
zeno (Administrator)

Originally Posted by
tmcalvin
I'm not really sure, I might be making stuff up. I'm really weak with php.
basically what I'm wondering is if you could see the code that is used to get the results, not just the output.
kinda the same way you can look at html & js and see how it works.
I hope that makes sense like it does in my head.
You'd need FTP access to get the source files. It's simply not possible as the act of requesting the PHP files causes the servers PHP engine to process it and deliver the results.
07-18-2013 01:38 AM
#41
tmcalvin (Member)

Originally Posted by
zeno
You'd need FTP access to get the source files. It's simply not possible as the act of requesting the PHP files causes the servers PHP engine to process it and deliver the results.
thanks zeno
that's what I was wondering, didn't know if there was a way around it
07-18-2013 10:31 AM
#42
caurmen (Administrator)
@janluc - Hmm, interesting. I'm in the UK, and obviously I'm not seeing city data. It may be that MaxMind's JS is currently not working to show accurate cities outside the US.
I'll have the tutorial for alternate techniques up today or tomorrow. Warning - you may have to spend a bit to get city data, I'm not 100% certain if there's a free option other than MaxMind out there. However, at least it'll be self-hosted and reliable!
07-20-2013 03:20 PM
#43
janluc (Member)

Originally Posted by
caurmen
@janluc - Hmm, interesting. I'm in the UK, and obviously I'm not seeing city data. It may be that MaxMind's JS is currently not working to show accurate cities outside the US.
I'll have the tutorial for alternate techniques up today or tomorrow. Warning - you may have to spend a bit to get city data, I'm not 100% certain if there's a free option other than MaxMind out there. However, at least it'll be self-hosted and reliable!
Caurmen, if you are located in UK (not browsing through HMA) and doesn't seeing city data - it's an answer why my UK and IE campaigns performs so poor.
If Maxmind doesn't show properly ALL of the countries and cities there is the only way to buy it or use something else. What paid options are there? Or, maybe, it's better to switch to using {state:} tag on LP's? But, as far as I know, it will not show cities, only states..
Anyway, your tutorial will be very appreciated.
08-06-2013 11:23 AM
#44
caurmen (Administrator)
Unfortunately, UK IP-based geolocation data tends to perform pretty badly even at the best of times. Because of the locations of our ISPs, a lot of IPs will come back with incorrect locations or no location at all.
If you have an alternate source of location data, like POF's {state:} tag, I'd definitely use that instead.
BTW, tutorial is up, at http://stmforum.com/forum/showthread...our-Own-Server
Home >
Programming, Servers & Scripts >