WASHINGTON — Technology companies have taken plenty of hits on privacy this year. In May, Europe began enforcing a sweeping new law that lets people request their online data and restricts how businesses obtain and handle the information.

Then in June, California passed its own law that gives people the right to know what information companies are collecting about them, why the companies are collecting that data and with whom they are sharing it — setting a privacy benchmark for the United States.

Now top tech companies are going on the offensive.

In recent months, Facebook, Google, IBM, Microsoft and others have aggressively lobbied officials in the Trump administration and elsewhere to start outlining a federal privacy law, according to administration officials and the companies. The law would have a dual purpose, they said: It would overrule the California law and instead put into place a kinder set of rules that would give the companies wide leeway over how personal digital information was handled.

“We are committed to being part of the process and a constructive part of the process,” said Dean Garfield, president of a leading tech industry lobbying group, the Information Technology Industry Council, which is working on proposals for the federal law. “The best way is to work toward developing our own blueprint.”