Geoplugin.com’s Geotargeting Service

Applications

Autopopulating our country dropdown list with the correct country

An Inbound Now customer has asked to be able to automatically set his country select dropdown to the correct country when a visitor accesses his signup page. To get this done we are using the geoplugin.com ip lookup service, who provides us with enough free lookup calls to handle the traffic this this customer’s website will see.

To implement this solution we used WordPress standards to implement the remote javascript file provided by geoplugin.com and then another WordPress hook to use that data to set our dropdown to the correct country code.

Here’s an example of what the final modification looked like in our customer’s theme’s functions.php file:

For more information on how to use the geolocation powers of geoplugin.com’s javascript insert please see this documentation resource:

http://www.geoplugin.com/webservices/javascript