This will return "device" for all devices. You can use the below code snippet to detect if the user is viewing in a mobile device. This is a more better version:- ...