Daniel Goodman / Business Insider A new feature in Apple's upcoming iPhone operating system iOS 8 makes it harder for companies to learn about your location and habits when connecting to public WiFi.

The feature, which was first spotted by Swiss programmer Frederic Jacobs and has since been written about on Quartz, prevents marketers, retailers, and other companies from seeing your phone's identity.

Whenever a mobile device scans for public WiFi networks, that phone emits what is called a Media Access Control address, or MAC for short.

A MAC address is a unique identification number tied to your device. Marketing and analytics companies track these broadcasted MAC addresses to keep track of foot traffic in retail stores.

Store owners, in turn, can use this information to target shoppers with specific deals and offers based on their behavior.

Apple's new feature, however, prompts your iPhone to generate a random MAC address when it scans for public WiFi networks.

This means that although these agencies will be able to detect your device, they won't know whether or not the same device is returning to that particular location.

By generating random MAC addresses, Apple is thwarting marketers' attempts to track how long you've been in a store, where in the store you've been shopping, and other types of location data that can be traced back to your iPhone.

The addition is one of several smaller features Apple has baked into its new iPhone software that make the system stronger as a whole. Other minor yet useful features Apple didn't mention on stage include the ability to make voice phone calls over WiFi and browse privately in separate tabs in Safari.