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
BedrockMission!

Learn More

View all

Sign in to view all badges

Reverse Geocoding: get visitors' country

Avatar

Avatar
Level 1
dawei_hdtv
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
dawei_hdtv
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
dawei_hdtv
Level 1

04-06-2018

Good morning!

With AEM 6.4 we want to build a component that reacts to the current visitor's country. We get the GPS coordinates via HTML (if visitor confirms). In AEM 5.6 we had a 'compute Address' function which returned the country and more details (it was based on Google Maps). This function was removed in 6.2 and up.

As it is possible to use the ContextHub to design localized experience, I figured that AEM must still have a way to determine the visitors' geographic location.

(How) Can I access this information in my component? The alternative is to get a license for Google Maps etc. but it would be overhead if AEM does have its own API.

I could not find a definitive answer in how far current AEM is equipped for this. Any explanation is very much appreciated, thank you!

Replies

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

04-06-2018

Avatar

Avatar
Level 1
dawei_hdtv
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
dawei_hdtv
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
dawei_hdtv
Level 1

04-06-2018

Thank  you for the quick response.

I had looked into this and worked with the ContextHub. But what we saw looking into the corresponding ContextHub JS object is that on Author the values will be correctly filled according to the manual selection in the preview (Beijing, Paris etc.), but on Publisher the object is empty. All geographic information is missing and not initialized. It should be possible to access the geogrpahic information if ContextHub was working properly, right?

Avatar

Avatar
Validate 1
Level 1
smrithig4775845
Level 1

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
smrithig4775845
Level 1

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
smrithig4775845
Level 1

03-08-2018

HIdawei.hdtv​, even I am facing similar issue, where the publish instance is not having address and addressDetailsOf items using ContextHub. I noticed that since the contextHub UI is not visible in Publish instance, the location items will not be displayed in the local storage. Wondering how can we fetching the address for Geo location on Publish instance? Can someone please help here?

Avatar

Avatar
Validate 1
Level 3
subrato_kha
Level 3

Likes

10 likes

Total Posts

49 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Validate 1
Level 3
subrato_kha
Level 3

Likes

10 likes

Total Posts

49 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 1
Give Back 5
View profile
subrato_kha
Level 3

10-09-2018

I am also facing the same issue

Avatar

Avatar
Give Back 3
Level 2
saik8550271
Level 2

Like

1 like

Total Posts

20 posts

Correct Reply

1 solution
Top badges earned
Give Back 3
Give Back
Ignite 1
Validate 1
Boost 1
View profile

Avatar
Give Back 3
Level 2
saik8550271
Level 2

Like

1 like

Total Posts

20 posts

Correct Reply

1 solution
Top badges earned
Give Back 3
Give Back
Ignite 1
Validate 1
Boost 1
View profile
saik8550271
Level 2

11-03-2019

Even I am also facing same problem

Avatar

Avatar
Give back 300
MVP
Gaurav-Behl
MVP

Likes

243 likes

Total Posts

1,145 posts

Correct Reply

281 solutions
Top badges earned
Give back 300
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Give back 300
MVP
Gaurav-Behl
MVP

Likes

243 likes

Total Posts

1,145 posts

Correct Reply

281 solutions
Top badges earned
Give back 300
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Gaurav-Behl
MVP

11-03-2019

Per my knowledge, you should use API (free/paid) to get updated info or use open source json/xml data for this use case. There is open source data available on web, just host it anywhere and utilize it per your use case.

Avatar

Avatar
Give Back 5
Level 2
notyourcat
Level 2

Likes

7 likes

Total Posts

15 posts

Correct Reply

1 solution
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Level 2
notyourcat
Level 2

Likes

7 likes

Total Posts

15 posts

Correct Reply

1 solution
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
notyourcat
Level 2

11-10-2019

You need to implement you own geolocation store if you want to get this information. Geolocation store from context hub will only do reverse geocoding when context hub ui is enabled (authoring edit/preview) and not in publish mode. I'm guessing this is due to licensing issues. If you check the jcr node of the geolocation store you may see the key they are using to do the reverse geolocation, but I'm guessing thats not for public usage.

This geolocation store can then only persist the latitude and longitude of the user which is fetched using the HTML5 geolocation api.

I'm all for a more clear documentation of the actual OOB capabilities of the context hub this and stop the annoying propaganda of the toy store example which is conveniently setup to hide all this shortcomings.