locked
detect what mobile device my visitor is using while browsing website. RRS feed

  • Question

  • User944339287 posted

    hi guys.. i gonna detect what mobile device my visitor is using while browsing website.

    in more detail.. like using iphone 6, note 4, google pixel and etc

    below is the below i have found so far. is there any  other good method out there?

    http://detectmobilebrowsers.com/

    Friday, June 30, 2017 1:15 AM

All replies

  • User-707554951 posted

    Hi  kengkit,

    In ASP.NET, you can easily detect the mobile device request using Request.Browser.IsMobileDevice property and Request.UserAgent.

    string strUserAgent = Request.UserAgent.ToString().ToLower();
    if (strUserAgent != null)
    {
        if (Request.Browser.IsMobileDevice == true || strUserAgent.Contains("iphone") || 
            strUserAgent.Contains("blackberry") || strUserAgent.Contains("mobile") || 
            strUserAgent.Contains("windows ce") || strUserAgent.Contains("opera mini") || 
            strUserAgent.Contains("palm"))
      {
            Response.Redirect("DefaultMobile.aspx");
      }
    }

    Or Use 51Degrees.mobi .NET Mobile API To Detect The User-Agent.

    For more information, please refer to the following links:

    https://www.codeproject.com/Articles/213825/ASP-net-Mobile-device-detection

    http://www.codeguru.com/csharp/.net/net_asp/miscellaneous/article.php/c16481/Mobile-Device-Detection-and-Redirection-Using-ASPNETMVC.htm

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Best regard

    Cathy

    Friday, June 30, 2017 9:43 AM
  • User-1974209137 posted

    While other Web metrics software packages have fallen to the wayside over the years, Google Analytics (GA) platform has risen to the top as the de facto standard for website reporting and statistics. Simply put, the platform is indispensable for any business or organization that wishes to gain deeper insight into their website traffic—namely, information on how visitors find your site, their <g class="gr_ gr_4 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" id="4" data-gr-id="4">activity</g> and behaviors while visiting, and what they are using to view your website. 

    Friday, July 6, 2018 9:58 AM
  • Friday, July 6, 2018 10:15 AM