Microsoft Corp. and Google Inc. told lawmakers on July 9 that Congress should pass basic privacy legislation to protect information about consumers, such as the data being gathered about people’s Web surfing habits in order to pinpoint Internet advertising.

At a Senate Commerce Committee hearing on online advertising, representatives of the two technology rivals said meaningful privacy rules should be based on three core principles: Consumers should be clearly notified what information is being collected about them; people should control how that information is used; and such data should be secured to ensure it does not fall into the wrong hands.