I don't know about IP, but if they have geolocation turned on... you can get latitude and longitude.
var fail; var latitude; var longitude; function getLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { fail = "Geolocation is not supported by this browser."; console.log(fail); } };
function showPosition(position) { latitude = "Latitude: " + position.coords.latitude; longitude = "Longitude: " + position.coords.longitude; console.log(latitude); console.log(longitude); };
getLocation();
You can, of course, send this back to a SL variable.
10 Replies
Hello Joanna,
https://www.ipify.org/ has a service that returns a Client's IP Address.
Here is a sample storyline project for you to take a look at.
I don't know about IP, but if they have geolocation turned on... you can get latitude and longitude.
var fail;
var latitude;
var longitude;
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
} else {
fail = "Geolocation is not supported by this browser.";
console.log(fail);
}
};
function showPosition(position) {
latitude = "Latitude: " + position.coords.latitude;
longitude = "Longitude: " + position.coords.longitude;
console.log(latitude);
console.log(longitude);
};
getLocation();
You can, of course, send this back to a SL variable.
That's brilliant Russell. Thanks so much for your help.
This post was removed by the author
Thanks Owen. Russell's solution works great and I may use your Geolocation idea in any future project. Thanks for contributing.
Hi Joanna, I'm curious what the use case is for tracking learners' IP addresses.
I would be concerned about any possible GDPR issues here
I asked the same question our PM when I found out about it
Hello,
Is it possible to provide this in an older format? I can't open your sample in Storyline 3.
Thanks!
See attached a version that should open in SL3.
Thank you! I was able to open the file.
Sorry for the delayed response.
This discussion is closed. You can start a new discussion or contact Articulate Support.