dynamic content depending of the geographic location of browser ?
Hi , guys, is there any good way to display different content based on the latitude and longitude of the user browser?
I was thinking to load all the content for one page and then use JS to programmatically display part of them based on the navigator.geolocation.getCurrentPosition but this way introducing lots of hidden content.
Or in the page load, send the ajax request with the latitude and longitude info to Umbraco REST endpoint to get the content but this way may increase network traffic.
Depending on what you are building, I would suggest the second approach.
If you need to select a language, base it on what accept-language header. If you need to show “local news” use the lst/lng as you describe. Remember to always have a fallback, so you don’t end up having blank spots on your pages.
dynamic content depending of the geographic location of browser ?
Hi , guys, is there any good way to display different content based on the latitude and longitude of the user browser?
I was thinking to load all the content for one page and then use JS to programmatically display part of them based on the navigator.geolocation.getCurrentPosition but this way introducing lots of hidden content.
Or in the page load, send the ajax request with the latitude and longitude info to Umbraco REST endpoint to get the content but this way may increase network traffic.
Is there any better way to do it ?
Cheers,
A
Hi,
Depending on what you are building, I would suggest the second approach.
If you need to select a language, base it on what accept-language header. If you need to show “local news” use the lst/lng as you describe. Remember to always have a fallback, so you don’t end up having blank spots on your pages.
HTH, Søren
What kind of content do you actually want to add?
Hi Adrian
Have you seen this package https://our.umbraco.com/projects/website-utilities/personalisation-groups/
Perhaps this can help you doing what you are trying to archive
Hope this helps,
/Dennis
is working on a reply...