SACRAMENTO — Over protests from the tech lobby, California senators passed legislation on Thursday that would limit what information online retailers can collect from their customers.

Senate Bill 383 would still allow online merchants to log their credit card-paying customers’ billing addresses and ZIP codes, but only if they use that information to battle identity theft and fraud. Merchants would eventually have to delete that data, and they would not be allowed to sell it to third-party brokers.

The bill, backed by consumer and privacy groups, is an attempt to legislatively address the state Supreme Court’s 2013 ruling in Apple Inc. v. Superior Court (Krescent). Justices held that state law restricting what information brick-and-mortar stores can collect from customers does not apply to e-tailers.

SB 383 received a bare-minimum 21 votes. One senator, Ted Lieu, D-Torrance, said that he was voting yes as a courtesy to the author, Santa Barbara Democrat Hannah-Beth Jackson, and he urged her to negotiate more changes to the bill with the tech industry. Two Silicon Valley senators, Jim Beall, D-San Jose, and Jerry Hill, D-San Mateo, did not vote for SB 383.

Business groups argue that the bill will actually hurt fraud detection efforts by limiting merchants’ ability to track their customers’ purchases. The bill is opposed by TechNet, the Internet Alliance, CTIA–The Wireless Association and law firm McDermott Will & Emery.

SB 383 now moves to the Assembly.

Contact the reporter at cmiller@alm.com.