Home > Programming, Servers & Scripts >

How to pass Latitude & Longitude to CDN hosted lander? (3)


12-23-2014 08:12 PM #1 integrity (Member)
How to pass Latitude & Longitude to CDN hosted lander?

Is there any way for me to pass a visitor's latitude and longitude to a static lander hosted on a CDN?

Here's how I have it set up right now with generic values:

Code:
<script type="text/javascript">
            var lat = 11.1111, lng = -11.1111, city = "";
        </script>
If not, would moving to a VPS and using something like the Maxmind World Cities database be the best option?

Been looking endlessly for solutions around the web but haven't found anything. The guides I read on here were also pertinent to installing a Maxmind GeoIP database on your own server. Would appreciate any pointers here.

Thanks.


12-24-2014 01:14 AM #2 zeno (Administrator)

You can use location sharing but I wouldn't recommend this since it requires user intervention.

The best way would be if the tracker can look this info up and then pass it through in the URL.

The second best way would be getting the info from a GeoIP service - either your own hosted on a server somewhere or a service like Maxmind's.

Never thought about the Maxmind World Cities database, not sure how accurate it is? Seems they openly don't support it, contains incorrect/dupe info etc.


12-24-2014 10:12 AM #3 integrity (Member)

Thanks for the help, Zeno.

I think I'm just going to set the database up on my own server like you said. If passing the lat & long from there to the CDN lander becomes too complicated I'll just move the pages over to the server as well.

Will report back with my results.


Home > Programming, Servers & Scripts >