0

I'm thinking about a possiblity for showing a users geolocation in an email. Would it be possible to generate a dynamic image with PHP which tracks the users geolocation and gives back an image.

Generating a dynamic image is no problem. But before I put too much effort in it, I try to find out if it's even possible or do I have to use a geo database instead?

While searching I came across HTML5 geo tracking: http://html5demos.com/geo

I wonder if I can use google maps API in order to generate my image.

Any suggestions/tips?

Thanks!

IE-hater
  • 115
  • 1
  • 9

1 Answers1

1

HTML5 geolocalization is probably not the best idea here, because it requires user to accept the tracking (and it can be not possible in some email clients other than web browsers or be simply blocked by them)

In this case it would be probably better to use some kind of GeoIP database and use Google Maps API to generate static image based on coordinates https://developers.google.com/maps/documentation/imageapis/

Note, that most email clients block external images by default.

sebapalus
  • 536
  • 3
  • 6
  • Do I have to subscribe for "Google Maps API for Business" then? I'm very aware of image blocking, thanks :) I have to deal with such problems all the time. – IE-hater Nov 05 '13 at 09:40
  • Depends on how many requests you're going to generate. You have 25,000 requests per day for free.You can lower the number of requests by doing some caching server-side based on ip or lat/lon. – sebapalus Nov 05 '13 at 09:55