question: How do websites know to go to the mobile version on your phone even when you click a desktop link but don't know how to go to the desktop version on your desktop if you click a mobile link?
comment: When you send a request for a website, you send information about your device and what exactly you are after in the headers of a request. There is a header called "user-agent" this basically defines what device you are on. Mine for example says "Mozilla/5.0 (Linux; Android 8.1.0; SM-T580) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36". Therefore websites know that my device is an android device, so they know to deliver the mobile version to my device.
passages: Due to the high volume of internet traffic using mobile devices, they can no longer be ignored. In 2014, for the first time more users accessed the internet from their mobile devices than desktop. Where a web site must support basic mobile devices that lack JavaScript, browser ("user agent") detection (also called "browser sniffing") and mobile device detection are two ways of deducing if certain HTML and CSS features are supported (as a basis for progressive enhancement)—however, these methods are not completely reliable unless used in conjunction with a device capabilities database.
   Section::::Problems with tracking.:IP address.
  
  For desktop web browsing, the network address of the client machine usually gives some form of user identification and location. For mobile web browsing, the client IP address refers to the internet gateway machine owned by the network operator. For devices such as the BlackBerry or for phones using Opera Mini browser software, the IP address refers to an operator-owned internet gateway machine in Canada or Norway.
  
  Section::::Collecting mobile web analytics data.
   Websites designed so that they may be accessed from these browsers are referred to as "wireless portals" or collectively as the Mobile Web. They may automatically create "mobile" version of each page, for example the Wikipedia website.
  
  Section::::Underlying technology.
   "It is fundamentally useful to be able to quote the URI for some information and then look up that URI in an entirely different context. For example, I may want to look up a restaurant on my laptop, bookmark it, and then, when I only have my phone, check the bookmark to have a look at the evening menu. Or, my travel agent may send me a pointer to my itinerary for a business trip. I may view the itinerary from my office on a large screen and want to see the map, or I may view it at the airport from my phone when all I want is the gate number."
   Traditional analytics software on a mobile website only provides data for HTTP requests coming from the most advanced mobile browsers; such as those found in the iPhone and other smart phones and PDAs, with no data on other mobile devices browsing the site.
  
  Common web analytics software that use server log parsing to associate different IP addresses with "unique visits" may fail to actually identify unique visitors. This is due to IP addresses from each mobile device originating from a gateway IP address of the network access provider.
   BULLET::::- codice_3 is an example of a mobile deep link. The URI contains all the information needed to launch directly into a particular location within an app, in this case the profile with id '33138223345', i.e., the Wikipedia page, within the Facebook app, instead of simply launching the Facebook app codice_4.
  
  BULLET::::- eBay's apps demonstrate the use of different schemes by platform. codice_5 is the URI that deep links into eBay’s iOS app while codice_6 links into eBay’s Android app.
  
  Section::::Complexity of mobile deep linking and the need for a streamlined solution.
   In addition, mobile web analytics involve metrics and KPIs associated with mobile device information, such as model, manufacturer, and screen resolution. These data can usually be assembled by combining device identification information taken from special HTTP headers, such as user-agents, with device capabilities stored in a device information registry, such as WURFL. This method is not provided by traditional web analytics solutions because it is mobile web-specific.
  
  Section::::Problems with tracking.
  
  Section::::Problems with tracking.:Visitor identification.
   Supported browsers for me.com on both Mac and Windows were Safari 3.1 or later, and Firefox 3.5 or later, while Internet Explorer 8 and Internet Explorer 7 were Windows-only. Safari 3.0, and Firefox 3.0 would run the web applications, but were not fully supported.
  
  MobileMe was accessible from Linux using Firefox 3 despite a warning that would be presented to the user upon entry. Success was also reported using the Konqueror browser on Linux, however this was not confirmed by Apple.
  
  Section::::Services.:iChat/AIM.
   Section::::Collecting mobile web analytics data.:HTTP header analysis.
  
  This tells you a number of basic facts about the mobile phone and the browser. It can be used in conjunction with a device database such as WURFL.
  
  Section::::Collecting mobile web analytics data.:IP address analysis.
   Unlike the Web, where the underlying technology of HTTP and URLs allow for deep linking by default, enabling deep linking on mobile apps requires these apps be configured to properly handle a uniform resource identifier (URI). Just like a URL is an address for a website, a URI is the address for an app on a mobile device. Examples of URIs that launch a mobile app:
  
  BULLET::::- codice_1 is the iOS URI to launch Twitter’s mobile app
  
  BULLET::::- codice_2 is the iOS URI to launch YouTube’s mobile app
   The format of the URI used to trigger or deep link an app is often different depending on the mobile operating system. Android devices work through intents, BlackBerry 10 devices work through BB10's invocation framework, Firefox OS devices work through Web Activities, iOS devices work through the openUrl application method, and Windows Phone 8 devices work through the UriMapper class.
   BULLET::::- Types of pages accessible – many sites that can be accessed on a desktop cannot on a mobile device. Many devices cannot access pages with a secured connection, Flash or other similar software, PDFs, or video sites, although as of 2011, this has been changing.
  
  BULLET::::- Speed – on most mobile devices, the speed of service is slow, sometimes slower than dial-up Internet access.
  
  BULLET::::- Broken pages – on many devices, a single page as viewed on a desktop is broken into segments, each treated as a separate page. This further slows navigation.
   Several dynamic server-side platforms are used to develop mobile sites. Server-side tracking code is recommended for more accurate analytics reporting.
  
  Section::::Platforms.
  
  BULLET::::- HTML/JavaScript
  
  BULLET::::- WordPress Mobile Pack
  
  BULLET::::- PHP
  
  BULLET::::- .NET
  
  BULLET::::- Java
  
  BULLET::::- Python
  
  BULLET::::- ColdFusion
  
  BULLET::::- Ruby on Rails
  
  BULLET::::- node.js/Connect
  
  BULLET::::- TypePad Pro
  
  BULLET::::- Unify (Gravity4)
  
  Different tracking processes or mechanisms are available for each of the above platforms. For unsupported/HTML sites, the JavaScript pixel tracking mechanism is most commonly used.
   The majority of modern smartphones are able to browse websites, some with browsing experiences similar to those of desktop computers. The W3C Mobile Web Initiative identifies best practices to help websites support mobile phone browsing. Many companies use these guidelines and mobile-specific code like Wireless Markup Language or HTML5 to optimize websites for viewing on mobile devices.
  
  Section::::Drawbacks of applying traditional web analytics.
   To begin with, the way users interact with a cell phone or a tablet differs immensely from the way they interact with a desktop or laptop. The action of clicking with the mouse has been replaced with the action of swiping with a finger. Scrolling through longer pages with all the relevant information in one place has replaced top heavy navigation styles. These factors greatly influence the click-through rates, and consequently, the way web analytics can be used.
  
  Collecting mobile web analytics data has proven to be less straightforward than traditional web analytics due to a few defining factors.
   BULLET::::- Microsoft Bing — the option to enable or disable "Optimize web pages for your phone" in "Search settings" is not visible in Bing's mobile version as of March 2018. (The mobile version can be accessed with a phone or tablet, or when setting a web browser to identify itself with a mobile-based user agent string.)
  
  BULLET::::- MobileLeap Transcoding Engine, by MobileLeap Inc. — The site wouldn't allow entry without a cookie, so a typical crawler would be redirected to mlvb's cookiecheck page, the last snapshot of which is from 12 October 2017.
   An operator database is used to identify operators and their countries based on the IP addresses of their internet gateway devices. IP addresses alone do not identify all operators and countries, as some operators share their mobile networks with virtual network operators (MVNO). Boost Wireless, for example, uses the Sprint network. Because these two operators have very different customer demographics, clear differentiation between operators is critical for good mobile marketing campaigns. Carriers may also share their mobile internet gateways, sometimes across multiple countries, and many change or add gateways on a regular basis.
   HTTP referrer information showing where a visitor navigated from is generally not provided for mobile web browsing. This is either because the device manufacturer has disabled sending such information in the HTTP request to save bandwidth during network usage, or because the mobile network operator's internet gateway removes or alters the original HTTP header due to the gateway software or use of mobile web transcoding software.
  
  Section::::Problems with tracking.:Image tags.
  
  Handset caching mechanisms impact the use of images for page tagging. In some cases, image caching on handsets is performed regardless of any anti-caching headers output by the remote server.
   Images can be forced to work for mobile web analytics, provided that the transmitted image is always unique. The level of information recorded from these transmissions depends on the architecture provided by the supplier, and not all image beacon solutions are the same.
  
  Section::::Collecting mobile web analytics data.:Link redirection.
  
  Link redirection is an important method of tracking mobile visitor activities. It is the only reliable way to record clicks from advertising, search, and other marketing activities. It also records visitors clicking on links to leave a site. This method helps address the lack of HTTP referrer information on mobile.
   Because mobile websites are typically open to access from any kind of network - fixed, Wi-Fi, cellular wireless, satellite wireless, etc. - a traditional web analytics solution could range from fairly accurate to mostly inaccurate, depending on where the HTTP requests are coming from.
   Websites specifically targeted towards mobile phones, like NTT DoCoMo's I-Mode or Vodafone's Vodafone Live! portals, often rely heavily on user agent sniffing, since mobile browsers often differ greatly from each other. Many developments in mobile browsing have been made in the last few years, while many older phones that do not possess these new technologies are still heavily used. Therefore, mobile Web portals will often generate completely different markup code depending on the mobile phone used to browse them. These differences can be small, e.g., resizing of certain images to fit smaller screens, or quite extensive, e.g., rendering of the page in WML instead of XHTML.
   Some organizations try to increase the discoverability of a certain feature by adding animation, such as a moving "click here" icon. As of 2017, the addition of motion sensors and geotracking to mobile devices has made webpage design for discoverability more complex, because smartphones and tablets are typically capable of having many more inputs from the user than a 1980s era desktop, including "swiping" the touchscreen, touching images on the screen, or tilting the device. One of the challenges in webpage and app design is that the degree of sophistication and experience of users with navigating in the webpage or app environment varies a great deal, from individuals who are new to using these applications at one extreme to experienced computer users.
   mTLD, the registry for .mobi, has released a free testing tool called the MobiReady Report (see mobiForge) to analyze the mobile readiness of website. It does a free page analysis and gives a Mobi Ready score. This report tests the mobile-readiness of the site using industry best practices and standards.
  
  Other standards for the mobile web are being documented and explored for particular applications by interested industry groups, such as the use of the mobile web for the purpose of education and training.
  
  Section::::Development.
   Section::::Attacks based on vulnerabilities in software applications.
  
  Other attacks are based on flaws in the OS or applications on the phone.
  
  Section::::Attacks based on vulnerabilities in software applications.:Web browser.
  
  The mobile web browser is an emerging attack vector for mobile devices. Just as common Web browsers, mobile web browsers are extended from pure web navigation with widgets and plug-ins, or are completely native mobile browsers.
   Collection of mobile web analytics data requires a different approach from collecting traditional web analytics data. A number of solutions are available and the best results are obtained through the use of more than one technology.
  
  Section::::Collecting mobile web analytics data.:Packet sniffing.
  