Apple Inc.’s plan to allow anonymous sign-ins on mobile apps to protect users’ privacy threatens to choke off data to companies including Facebook and Google that use the information to track users and sell ads based on their habits.

When the iPhone maker releases its new mobile operating system this fall, apps downloaded through Apple’s App Store that offer sign-ups through a third-party social-media account such as Facebook will have another alternative: clicking on an Apple icon to generate a random email address so that...