@egreenman – It may be more worth your time to check out the advanced targeting extension( $14) if your anything like me, the time it takes you to get everything setup, tested and working correctly would be way more costly than the price of the extension. You could do this in just a few clicks as well as many other things.
To include the library you can check out the code example and get the files needed at https://mobiledetect.net/. If you are not familiar with PHP very much it may take some trial and error even with my assistance to get it set up & working correctly. Make sure you have FTP access to upload the PHP library files into your theme most likely and then use the “require /path/to/files/Mobile_Detect.php” prior to calling $detect = new Mobile_Detect;. Once you do that then you can call $detect->isMobile in your filter.