Geolocation Latitude/Longitude | Community
Skip to main content
SeVoR
June 22, 2016
Solved

Geolocation Latitude/Longitude

  • June 22, 2016
  • 4 replies
  • 3788 views

Hello,

I'm trying to figure out how to set up audiences for different Latitude/Longitude. It says in the Target documentation that it's possible to do - but it doesn't say how.

Thanks in advance for your help!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ParitMittal

Hi , 

This can be achieved through profile scripts. Once visitor has accepted the “Do you want to share your location” prompt on their phone/desktop, the javascript has the lat / long available.  At that point you send mboxparams of lat long to do like you mentioned to pass along and create profile scripts. The mbox Parameters for lat long are custom and can be named anything.  Might be nice to have a reserved mbox param name for mboxLat and mboxLong, and then create audience based on those . The Audience definition could be based on a contains string to allow for a range of lat/long.

Thanks & Regards

Parit Mittal

4 replies

ParitMittal
Level 10
June 23, 2016

Hi ,

As if now It's not possible to setup audiences for Geo Latitude & Longitude through Target Standard UI . However we are looking for the option whether we can achieve the same through Profile Scripts . We will get back to you on the same ASAP.

Thanks & Regards

Parit Mittal

May 11, 2021
My requirement is to switch country selector to show specified content based on the geolocation. We were planning to use Adobe Target approach to fetch geolocation and send it to AEM. Can you suggest the steps for the same
ParitMittal
ParitMittalAccepted solution
Level 10
June 24, 2016

Hi , 

This can be achieved through profile scripts. Once visitor has accepted the “Do you want to share your location” prompt on their phone/desktop, the javascript has the lat / long available.  At that point you send mboxparams of lat long to do like you mentioned to pass along and create profile scripts. The mbox Parameters for lat long are custom and can be named anything.  Might be nice to have a reserved mbox param name for mboxLat and mboxLong, and then create audience based on those . The Audience definition could be based on a contains string to allow for a range of lat/long.

Thanks & Regards

Parit Mittal

ParitMittal
Level 10
June 30, 2016

Hi Rob,

Is the problem resolved now ?. If not , Please let us know so that we can further help you with the same.

Thanks & Regards

Parit Mittal

May 21, 2018

Hi Allm

we would like to implement personalization on web pages based on geolocalization (latitude and longitude)

We can NOT use the coordinates used by Adobe, because they are based on IP Address.

We are obtaining the coordinates using the following javascript code in the page:

if (navigator.geolocation) {

                 navigator.geolocation.getCurrentPosition(my_position);

}else{

alert(Something goeas wrong');

}

function my_position (position) {

window.lat = position.coords.latitude;

window.lon = position.coords.longitude;

}

For example:

The variable window.lat will be set with the value: 45.44910443697823

The variable window.lon will be set with the value: 9.125338282382

If I print in the same page the Adobe variable (you can see they are different)

  1. profile.geolocation.latitude is set with the value 51.2347
  2. profile.geolocation.longitude is set with the value 6.71389

This happens because adobe define the latitude and longitude starting from the IP while the browser is using the right position of the user.

What I want to do is to OVERRIDE profile.geolocation.latitude and profile.geolocation.longitude with the right value we have from the browser

I tried to create a profile script like this

  1. profile.geolocation.longitude = window.lon;
  2. profile.geolocation.latitude = window.lat;

But of course it doesn’t work.

I'm trying to pass this value to the target global mbox using the following javascript code

targetPageParams = function() {

            return {

                "profile": {

                    "latitudine": window.lat,

                    "longitudine": window.lon

                }

            };

        }

but it seems it doesn't work. Can you please help?

Thank you

Best Regards

April 25, 2023

Hi,

I have similar requirement to update correct & accurate location. Please let me know if you get any solution for your approach. 

Regards,

Srinivas