API

These functions have dependency on jQuery

This will provide geolocation info of your visitors such as latitude, longitude, city, region, country and timezone. 

Usage
api.UserLoc().then(function (data) 
{
 console.log(data)
});


With "Is Mobile API" you can easily detect if your user is accessing your site from mobile or desktop.

Usage
//for mobile
api.IsMobile().then(function (data) 
{ 
 console.log(data)
}); 


Best practice

Call these functions 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.