Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Geolocation detection - IP2Location Integration

Avatar

Level 2

Have any one integrated IP2location plugin with AEM 6.1 for Geolocation detection? If so can you please share some details on this.

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi 

"Our use case is to identify the user location from where he is accessing website/mobile web and display shops nearest to his location"

I would not recommend you to use IP address to find the location, as it only gives you rough estimates, you can use "Geolocation" or "The Google Maps Geolocation API". There are many reliable other option that you can easily find on google.

 

"On using geoplugin I have following query. Can this be used for commercial purpose and will this be reliable "

The geoplugin was just an example shown to you so that you can implement ip to location via JavaScript. Reliability, i am not actually sure of. Please reach out to them to know exactly abut this. Link:- http://www.geoplugin.com/contact

 

"If we use IP2Location, how this can be deployed as an OSGi service in AEM and where IP2 database file can be stored in the infrastructure. Ref :http://www.ip2location.com/docs/ip2location-java-user-manual.pdf"

You can create a custom component which is reliable on third party jar. "IP2Location" provide jar libraries, you can use them as a library into a component.

Example of Creating a component using third party jars:- https://helpx.adobe.com/experience-manager/using/aem_wordpress.html

 

I hope this helps you.

Thanks and Regards

Kautuk Sahni

View solution in original post

5 Replies

Avatar

Administrator

Hi 

Can you please tell what exactly is your use case of using IP2location plugin ?

If the purpose if just to find out location from Ip address, then you can also try this Java Script plugin:-

Link:- https://helpx.adobe.com/experience-manager/using/custom-carousel-components.html (Create a custom component using third party JavaScript)

Link:- http://www.sitepoint.com/geo-location-2-lines-javascript/

Demo Code:- 

jQuery(document).ready(function($) {
    jQuery.getScript('http://www.geoplugin.net/javascript.gp', function() 
{
    var country = geoplugin_countryName();
    var zone = geoplugin_region();
    var district = geoplugin_city();
    console.log("Your location is: " + country + ", " + zone + ", " + district);
});
});

Following are the functions that can be called from the JavaScript.

function geoplugin_request() 
function geoplugin_status()
function geoplugin_credit()
function geoplugin_city() 
function geoplugin_region()
function geoplugin_regionCode()
function geoplugin_regionName() 
function geoplugin_areaCode() 
function geoplugin_dmaCode() 
function geoplugin_countryCode()
function geoplugin_countryName() 
function geoplugin_continentCode() 
function geoplugin_latitude() 
function geoplugin_longitude() 
function geoplugin_currencyCode() 
function geoplugin_currencySymbol() 
function geoplugin_currencySymbol_UTF8() 
function geoplugin_currencyConverter(amt, symbol)

I hope this would be helpful to you.

Thanks and Regards

Kautuk Sahni

Avatar

Level 2

Hi Kautuk Sahni,

Thanks for your reply. This is useful and simple way to detect Geolocation

Our use case is to identify the user location from where he is accessing website/mobile web and display shops nearest to his location (We have database of shops along with Zipcode and location coordinates)

On using geoplugin I have following query. Can this be used for commercial purpose and will this be reliable 

If we use IP2Location, how this can be deployed as an OSGi service in AEM and where IP2 database file can be stored in the infrastructure. Ref :http://www.ip2location.com/docs/ip2location-java-user-manual.pdf

Thanks,

Jalandar

Avatar

Correct answer by
Administrator

Hi 

"Our use case is to identify the user location from where he is accessing website/mobile web and display shops nearest to his location"

I would not recommend you to use IP address to find the location, as it only gives you rough estimates, you can use "Geolocation" or "The Google Maps Geolocation API". There are many reliable other option that you can easily find on google.

 

"On using geoplugin I have following query. Can this be used for commercial purpose and will this be reliable "

The geoplugin was just an example shown to you so that you can implement ip to location via JavaScript. Reliability, i am not actually sure of. Please reach out to them to know exactly abut this. Link:- http://www.geoplugin.com/contact

 

"If we use IP2Location, how this can be deployed as an OSGi service in AEM and where IP2 database file can be stored in the infrastructure. Ref :http://www.ip2location.com/docs/ip2location-java-user-manual.pdf"

You can create a custom component which is reliable on third party jar. "IP2Location" provide jar libraries, you can use them as a library into a component.

Example of Creating a component using third party jars:- https://helpx.adobe.com/experience-manager/using/aem_wordpress.html

 

I hope this helps you.

Thanks and Regards

Kautuk Sahni

Avatar

Level 2

Thanks Kautuk.. Information provided above are helpful