The two largest credit-card networks, Visa Inc. and MasterCard Inc., are pushing into a new business: using what they know about people's credit-card purchases for targeting them with ads online.

Their plans, if implemented, would represent not only a technological feat—tying people's Internet lives with shopping activities—but also an erosion of the idea of anonymity on the Web. It's an effort by the two companies to profit by selling access to the insights they gather about...