Executives from major technology companies including Apple and Google expressed broad support for a national consumer privacy law in a hearing Wednesday morning but offered few concrete specifics for how such a law might be best crafted.

In the wake of Facebook’s Cambridge Analytica crisis and other data-privacy scandals, lawmakers are no longer questioning whether technology companies should be regulated. The conversation on Capitol Hill has shifted to how they can design a consumer privacy law that would span a broad swath of U.S. tech and telecommunications companies with divergent data-collection practices.

The companies now seem eager to participate in the process, largely because they’re wary of a sweeping privacy law set to go into effect in California in 2020 that could usher in a wave of new state-level rules.

The tech leaders seemed to agree on broad privacy principles, such as giving users more transparency about how their data is being used. They used Wednesday’s hearing to educate lawmakers on their current privacy practices and controls, signaling that Congress should look to those practices as they craft a new law.

At a Senate Commerce Committee hearing Wednesday, executives from AT&T, Amazon.com, Google, Twitter, Apple and Charter appealed to Congress to develop national protections that would supplant state-level regulations. (Amazon CEO Jeffrey P. Bezos also owns The Washington Post.)

“If other states follow suit, we’ll be facing a patchwork of rules and fragmentation that will just be unworkable both for consumers as well as mobile companies and Internet companies,” said Leonard Cali, AT&T’s senior vice president for global public policy.

The California law was hailed by consumer advocates as offering landmark protections for consumers online. And Democrats warned any federal law would need to have similar protections.

“We’re not going to get 60 votes for anything and replace a progressive California law, however flawed you may think it is, with a nonprogressive federal law,” said Sen. Brian Schatz (D-Hawaii).

Industry support for a privacy bill comes a day after the Commerce Department floated a data-privacy framework. Industry trade groups and Google have also released potential frameworks in recent weeks.

But the diversity of platforms and business models on display at the hearing illustrated the challenge for Congress as it works to create a bill that would address social media platforms, Internet service providers and more.

“There’s often a temptation to lump technology leaders like this together, as if they are all the same,” said Sen. John Thune (R-S.D.), the Commerce Committee’s chairman.

Apple’s vice president for software technology, Bud Tribble, said the company supports a comprehensive bill that would meet the high bar set by the California legislation. Apple’s definition of privacy goes beyond just giving users the right to decide what information they don’t want to share with the company, Tribble said. The company, he said, believes it should automatically be walled off from its customers’ information.

“We want your device to know everything about you,” Tribble said. “We don’t think that we should.”

Lawmakers have been turning up the heat on tech companies in the wake of revelations about Russia-backed disinformation campaigns on their platforms during the 2016 presidential election. Facebook also came under fire after reports exposed that an analytics firm with ties to Donald Trump’s campaign gained access to personal data on millions of users. The controversy exposed the company’s data-sharing practices with third parties and sparked a broader debate about customers' online privacy rights.

Some of the other battles technology companies are fighting in Washington came up during Wednesday’s hearing, giving a preview of what Silicon Valley executives can expect during future trips to Capitol Hill.

Though lawmakers struck a largely conciliatory tone at the hearing, Google Chief Privacy Officer Keith Enright faced the most heat. Enright fielded questions from both sides of the aisle on reports of Google’s business plans for a search engine in China, and Sen. Ted Cruz (R-Texas) pressed him on whether the company was biased against conservative voices on the platform. The questions could be a preview of what is to come for Google CEO Sundar Pichai when he testifies later this year.

Consumer advocacy groups were critical of the committee’s decision to hold an industry-only hearing on privacy, insisting that they should be included in the discussion. Addressing the criticism in his opening remarks, Thune said this would be the first of several hearings on a federal privacy law.

Lawmakers say these discussions will probably continue past the midterm elections into 2019, when they plan to pass privacy legislation.

Correction: A previous version of this article misidentified the senator who pressed Google Chief Privacy Officer Keith Enright. It was Sen. Ted Cruz (R-Texas). A previous version also misstated the state Sen. Thune represents. He represents South Dakota, not North Dakota.