SAN FRANCISCO — A small firm called Definers Public Affairs brought the dark arts of Washington’s back-room politics to Silicon Valley when, while working for Facebook, it began disparaging other tech companies to reporters.

But a few days before Sheryl Sandberg, Facebook’s chief operating officer, testified to Congress in September, Definers set its sights on a different target: the senators about to question Ms. Sandberg.

In one document circulated to reporters, Definers tallied what software the 15 members of the Senate Intelligence Committee used to track visitors to their Senate websites. Another document detailed how much each senator spent on Facebook ads and how much they had received in campaign donations from Facebook or other big tech companies.

Known in the political business as opposition research, the documents pushed out by Definers neatly provided reporters with the ammunition they would need to suggest the senators grilling Ms. Sandberg were hypocrites for criticizing Facebook.