Highlighted

ContextHub doesn't show location value as part of CentextHubPersistence Local storage in publisher

subrato_kha

10-09-2018

Hi All,

We have a requirement where we want to get the exact location details using "ContextHubPersistence" local storage variable.

When we allow the location tracker in author mode to track our location it adds the address details correctly in "ContextHubPersistence" local storage variable.

But this doesn't work in publish mode/publish instance even though we click allow location track when the browser prompts.

for example:

Author:

Screen Shot 2018-09-10 at 15.40.13.png

Publish:

Screen Shot 2018-09-10 at 15.33.43.png

author has the address and addressDetailsOf object present where as it is not present in publish instance.

Is there a way to enable it or publish instance?

Replies

Highlighted

kautuk_sahni

Community Manager

11-09-2018

Linking Duplicate question:-

Checking with internal expert if something more needed for publishing.

Highlighted

subrato_kha

26-07-2020

hey @Venkatasainath : Reverse geocoding is no more available OOTB feature in AEM. Only available in author for demo purpose with limit to number of requests.

You need to use any reverse geocoding api service to get the location for eg:-google api from the latitude and longitude to locate the address. 

Highlighted

Venkatasainath

26-07-2020

@subrato_kha thanks for the reply.

but how do I put address object in localstorage(ContextHubPersistence)?

my personalization works on address object.

Highlighted

subrato_kha

26-07-2020

Hi @Venkatasainath ,

you can paas the latitude and longitude value using servlet to a backend service. Backend service will use any api like google reverse geocoding to give you address object in your format. You can persist the address in contexthub localstorage which will resolve your segment. You can also check if reverse geocoding is available in any web sdk then backend is not needed. It will be faster.