Google wants to know where you go so badly that it records your movements even when you explicitly tell it not to.

An Associated Press investigation found that many Google services on Android devices and iPhones store your location data even if you've used a privacy setting that says it will prevent Google from doing so.

Computer science researchers at Princeton confirmed these findings at the AP's request.

For the most part, Google is upfront about asking permission to use your location information. An app like Google Maps will remind you to allow access to location if you use it for navigating. If you agree to let it record your location over time, Google Maps will display that history for you in a “timeline” that maps out your daily movements.

Storing your minute-by-minute travels carries privacy risks and has been used by police to determine the location of suspects. So the company will let you “pause” a setting called “location history”.

Google says that will prevent the company from remembering where you've been. Google's support page on the subject states: “You can turn off Location History at any time. With Location History off, the places you go are no longer stored.”

That isn't true. Even with “location history” paused, some Google apps automatically store time-stamped location data without asking.

For example, Google stores a snapshot of where you are when you merely open its Maps app. Automatic daily weather updates on Android phones pinpoint roughly where you are. And some searches that have nothing to do with location, such as “chocolate chip cookies” or “kids science kits”, pinpoint your precise latitude and longitude accurate to the square foot and save it to your Google account.

The privacy issue affects about 2 billion users of devices that run Google's Android operating software and hundreds of millions of worldwide iPhone users who rely on Google for maps or search.

Storing location data in violation of a user's preferences was wrong, said Jonathan Mayer, a Princeton computer scientist and former chief technologist for the Federal Communications Commission's enforcement bureau. A researcher from Mayer's lab confirmed the AP's findings on multiple Android devices; the AP conducted its own tests on several iPhones that found the same behavior.

“If you're going to allow users to turn off something called ‘location history’, then all the places where you maintain location history should be turned off," Mayer said. “That seems like a pretty straightforward position to have.”

Google says it is being perfectly clear.

“There are a number of different ways that Google may use location to improve people's experience, including: Location History, Web and App Activity, and through device-level Location Services,” a Google spokesperson said in a statement to the AP. “We provide clear descriptions of these tools, and robust controls so people can turn them on or off, and delete their histories at any time.”

To stop Google from saving these location markers, the company says, users can turn off another setting, one that does not specifically reference location information. Called “web and app activity” and enabled by default, that setting stores a variety of information from Google apps and websites to your Google account.

When paused, it will prevent activity on any device from being saved to your account. But leaving “web and app activity” on and turning “location history” off only prevents Google from adding your movements to the “timeline”, its visualization of your daily travels. It does not stop Google's collection of other location markers.

You can delete these location markers by hand, but it's a painstaking process since you have to select them individually, unless you want to delete all of your stored activity.

You can see the stored location markers on a page in your Google account at myactivity.google.com, although they are typically scattered under several different headers, many of which are unrelated to location.

Huge tech companies are under increasing scrutiny over their data practices, following a series of privacy scandals at Facebook and new data-privacy rules recently adopted by the European Union. Last year, the business news site Quartz found that Google was tracking Android users by collecting the addresses of nearby cellphone towers even if all location services were off. Google changed the practice and insisted it never recorded the data anyway.

Critics say Google's insistence on tracking its users' locations stems from its drive to boost advertising revenue.

Google offers a more accurate description of how “location history” actually works in a place you would only see if you turn it off: a popup that appears when you “pause” Location History on your Google account webpage. There, the company notes that "some location data may be saved as part of your activity on other Google services, like Search and Maps”.

Google offers additional information in a popup that appears if you reactivate the “web and app activity” setting – an uncommon action for many users, since this setting is on by default. That popup states that, when active, the setting “saves the things you do on Google sites, apps, and services … and associated information, like location”.

Since 2014, Google has let advertisers track the effectiveness of online ads at driving foot traffic, a feature that Google has said relies on user location histories.

The company is pushing further into such location-aware tracking to drive ad revenue. At a Google Marketing Live summit in July, Google executives unveiled a new tool that uses ads to boost in-person store visits. It says it can measure how well a campaign drove foot traffic with data pulled from Google users' location histories.

Google also says location records stored in My Activity are used to target ads. Ad buyers can target ads to specific locations, say, a mile radius around a particular landmark and typically have to pay more to reach this narrower audience.