How to identify mobile or desktop device accessing your Shopify store?
by Kiet Huynh · December 4, 2018
Sell Online With Shopify
Trusted by millions of businesses worldwide
Sign up for a free trial and enjoy 3 months of Shopify for $1/month on select plans.
You want to detect mobile or desktop device accessing your Shopify store to do a task: If customer is accessing the site from a mobile device execute script A, else execute script B.
The below Javascript to help you do that.
| <script> var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|webOS|BlackBerry|IEMobile|Opera Mini)/i); if(isMobile){ //Script for Mobile }else{ //Script for Desktop } </script> |
DEMO
Related
Related Posts via Categories
Looking for Shopify Experts?
Hura Apps can help you take your store to the next level
Our team of experienced designers and developers can help you create a beautiful, high-converting Shopify store that will drive sales and increase customer satisfaction. From custom design to app development and optimization, we have the skills and expertise to help you achieve your eCommerce goals.
Get in touchTags: detect devicesdetect mobilejavascript
You may also like...