A hidden feature buried deep in the architecture of both Apple and Android phones is secretly keeping a record of every place you visit.

Although the data is easy to delete, the feature must be turned off manually via your phone’s settings, and many users do not even know the feature exists.

The feature also keeps track of how long you stay in a particular location, giving Google and Apple the ability to determine where you work and where you live.

To delete your data or turn off the feature, Apple users must access the folder “Location Services” via their phone’s settings pages, before accessing the “Frequent Locations” setting. There, they can see their full location logs and, if they choose, turn the feature off.

Android users should access Google Location Settings via their phone’s settings page, where they will find an option marked “Reporting and Location History.” There they can view or delete their location logs and turn the feature off.

Google’s tracking feature is harder to escape than Apple’s, however — unless you switch the feature off on all your Google accounts, your phone could still track you.

Speaking to WPIX news, retired NYPD detective Patrick J. Brosnan said the feature was useful for law enforcement.

“It’s both a homing device and it’s a confession,” said Brosnan. “There’s a range of cases that the information obtained from the phone, established innocence or guilt.”

Location data has also been successfully used in civil cases. Divorce attorney Robert Wallack told WPIX, “If someone claims they’re at work or away, we’re able to find out they’re not; and doing things they shouldn’t be doing.”

Civil liberties campaigners have long warned against the dangers of digital location tracking. In 2011, when researchers discovered the iPhone’s ability to constantly track its user’s geolocation, campaign group Big Brother Watch argued that people should be able to “move around freely without accumulating a digital record of all their movements.”

You can follow Allum Bokhari on Twitter, add him on Facebook, and download Milo Alert! for Android to be kept up to date on his latest articles.