These functions have dependency on jQuery
This will provide geolocation info of your visitors such as latitude, longitude, city, region, country and timezone.
Usageapi.UserLoc().then(function (data) { console.log(data) });Results
Call this function on page load and save the data in a div, cookie, or any other method you would like to. This way the info is ready for you to use.
Otherwise, you will have to wait for the api call to finish which could result in unexpected response.