The dark truth about fingerprinting hardware is that it can be used to specifically target particular weaknesses of mobile devices. Using embedded magnetometer, gyroscope, and accelerometer, any web page can determine your device type by serving up some script. What this also means is that a mobile web site tab can pretty much follow you around town all day, even without GPS.
Privacy Measures by Mobile Devices
To protect user privacy, both Android and iOS have applied a variety of measures to prevent device fingerprinting. In Android, the countermeasures are usually enforced by requiring developers to ask for user permission to use privacy-sensitive APIs. For instance, the READ_PHONE_STATE permission enables developers to access the IMEI (International Mobile Equipment Identity) number and the phone number. The ACCESS_WIFI_STATE and BLUETOOTH permissions allow developers to access the MAC address of the WLAN and Bluetooth modules, respectively. These identifiers make good device fingerprints since they are globally unique and are difficult to change, and a recent study has shown that the ACCESS_WIFI_STATE permission, an install-time permission, has been used in 41% of 2700 most popular apps in the Google Play Store.
Currently, there is no reliable way to get a unique identifier for iOS devices. To address privacy concerns, Apple removed developer access to the UDID (Unique Device Identifier) and MAC addresses of hardware modules in iOS 7. From iOS 11, Apple introduced Intelligent Tracking Prevention (ITP) to mobile Safari, the default web browser on iOS that holds around 15% of the global browser market, to restrict cookie tracking.
https://www.ieee-security.org/TC/SP2019/papers/405.pdf
The trick of it.
Sensors. Lots of em. And a web browser.
The Android platform supports three broad categories of sensors:
- Motion sensors These sensors measure acceleration forces and rotational forces along three axes. This category includes accelerometers, gravity sensors, gyroscopes, and rotational vector sensors.
- Environmental sensors These sensors measure various environmental parameters, such as ambient air temperature and pressure, illumination, and humidity. This category includes barometers, photometers, and thermometers.
- Position sensors These sensors measure the physical position of a device. This category includes orientation sensors and magnetometers.
According to this white paper, different techniques are used. Sometimes they involve the precision and gain of readings, calibration data, frequency of updates, and fluctuation in readings.
Gryoscopes (3-axis)

Magnetometer
Here’s a sample of some javascript code from Mozilla:
let magSensor = new Magnetometer({frequency: 60});
magSensor.addEventListener('reading', e => {
console.log("Magnetic field along the X-axis " + magSensor.x);
console.log("Magnetic field along the Y-axis " + magSensor.y);
console.log("Magnetic field along the Z-axis " + magSensor.z);
});
magSensor.start();

Other data characteristics

In this example, conversions and raw samples have different output characteristics. Sensor IDs can be uniquely identified and tracked from combined calibration data.
3D Tracking
Lots of scripts out there. You really only need a gyro and an accellerometer to track movement in real time. Could I be taking you with me on a trip to Niagara Falls, or to the bathroom, thereby showing you the interior layout of my house?