Track user's IP address with Storyline variable

Feb 27, 2019

Is it possible to gather and send to Google spreadsheet user's IP address from Storyline? Is it doable with a javascript + variable? 

We'd need to know where our users are based so we'd like ot track their IP address.

Any help is welcome :)

10 Replies
OWEN HOLT

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.

This discussion is closed. You can start a new discussion or contact Articulate Support.