1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mobile-friendly: how to detect a mobile device?

Discussion in 'Black Hat SEO' started by jumbo1, Apr 29, 2015.

  1. jumbo1

    jumbo1 Junior Member

    Joined:
    Apr 18, 2012
    Messages:
    153
    Likes Received:
    19
    Hi guys,

    I'm working on making my websites responsive.

    The first step to that is being able to detect when a visitor to your website is a mobile device (vs a desktop computer).

    What is the best way to achieve that? I've come through this website Detect Mobile Browsers - Open source mobile phone detection
    which offers a number of codes in different languages that seem to perform this task, but I'd like to know if there is any other "standard" way of detecting mobile devices.

    On another hand, I'm using Cloudflare for my websites. I tried to find out if CF offers a way of telling your website whether the visitor is a mobile device. I know there is an option in CF to redirect mobile traffic to the m.website.com version of your website, but that's not what I'm looking to do.

    Any help will be appreciated.
     
  2. veboo

    veboo Jr. VIP Jr. VIP

    Joined:
    Aug 22, 2014
    Messages:
    1,157
    Likes Received:
    701
    You can use Google ANalytics. It keeps records on mobile visits separately and which is very useful
     
  3. jumbo1

    jumbo1 Junior Member

    Joined:
    Apr 18, 2012
    Messages:
    153
    Likes Received:
    19
    I'm not talking about that.
    I need to detect when a visitor is a mobile device in order to serve the proper content.
     
  4. bobred

    bobred Junior Member

    Joined:
    Dec 21, 2011
    Messages:
    111
    Likes Received:
    70
    • Thanks Thanks x 1
  5. BlacKOcean

    BlacKOcean Newbie

    Joined:
    Mar 14, 2015
    Messages:
    32
    Likes Received:
    15
    I don't think there's another reliable way to detect a mobile device.
     
  6. roadhamster

    roadhamster Regular Member

    Joined:
    Mar 12, 2012
    Messages:
    348
    Likes Received:
    248
    Detection of mobile browsers is and will always be crappy. When there are new devices/ browsers on the market you have to change your detection-script, you don't want that.
    Best option in my opinion is to make your main site mobile friendly. Take a look at http://getbootstrap.com
    Small learning curve, easy to use. Your site looks great on large desktops, normal desktop, and all available mobile devices and tablets.
     
  7. jumbo1

    jumbo1 Junior Member

    Joined:
    Apr 18, 2012
    Messages:
    153
    Likes Received:
    19
    Thanks guys, your references clarified what I need to do!
     
  8. blasterweb

    blasterweb Regular Member

    Joined:
    Dec 18, 2014
    Messages:
    302
    Likes Received:
    81
    Occupation:
    Student
    Location:
    Europe
    You either make your site responsive or redirect your mobile users to your mobile website, either by detecting the users user agent or by redirecting them by screen size.