One of the libraries that analyzes this for you is Platform.js , and you can use it either on the client side or on the server side, as described on their opening page, the links to which are given above.
Here is a client side example:
<script type='text/javascript' src='platform.js'></script> <script type='text/javascript'> alert('you are using ' + platform.description + ' on an ' + (platform.manufacturer || 'unknown vendor') ) </script>
Please note that you will not get the manufacturer in regular browsers, but you must get the brand on mobile devices, for example, Apple, Samsung, etc.
source share