(TNS) — Dozens of lawmakers in Congress are using tracking tools on their campaign websites to collect personal information about online visitors, including some legislators who have lambasted Facebook and other social media companies for employing similar methods.

The revelations underscore how critical Internet tracking has become to politicians who seek information on voters in their districts to target them with advertising.

One senator removed tracking tools from his campaign website after his office was contacted by McClatchy, and another lawmaker pledged to put up a privacy alert about the tracking.

Many others did not respond to queries about their use. Among them was Rep. Paul Tonko, a Democrat from upstate New York who joined other legislators in scolding Facebook founder Mark Zuckerberg at a House hearing April 11.

“Users trusted Facebook to prioritize user privacy and data security, and that trust has been shattered,” Tonko told Zuckerberg.

Yet Tonko has been less than transparent with people visiting his re-election website. The site offers no warning that it employs a tracking tool that gathers information on those who land there.

In dozens of cases during the recently concluded midterm elections, candidates used a tracking tool, two of them, or even three, on their campaign websites without informing users. Such embedded tools can collect granular data — such as age, gender, location and even specifics about the computer the visitor is using, and sites he or she has visited — that is increasingly useful for campaign advertising, identifying possible supporters and even shaping political platforms.

Tonko was not the only lawmaker offering tough questions to Zuckerberg in public while employing a different strategy in private. Democratic and Republican legislators pelted Zuckerberg with criticism, only to use campaign websites that failed to alert visitors that their sites contained tools that snoop.

Some experts say that tracking tools can gather such valuable data that politicians may find themselves squirming to write privacy regulations for big tech companies without harming their own future re-election bids, which increasingly rely on deep voter profiles compiled through tracking for pinpoint advertising on social media, particularly Facebook.

In many cases, when contacted by a reporter, lawmakers declined to respond to queries about their use of tracking tools. In two cases, legislators made changes — or pledged to do so — to their websites.

That was the case with Rep. Bill Flores, a Republican from a Texas district surrounding Waco, who was critical of Zuckerberg at the April 11 hearing before the House Energy and Commerce Committee. Flores told Zuckerberg that any data Facebook releases to third parties “should be based on the absolute transparency as to what data will be used.”

On the Flores campaign website, billflores.com, Google Analytics and Facebook Pixel Code, powerful tools to gather data on visitors, are embedded in the site’s source code, hidden from all but the most tech savvy users.

Flores’s campaign said the basic website design was years old and that the campaign team “was not aware of the inclusion” of design features such as Google Analytics.

“These tools were not used by the campaign to track or target advertising. Now that we are aware that the vendor included these tools in our website design, we will soon add a privacy statement,” the campaign said in a statement.

Experts said politicians, some of whom displayed only cursory knowledge of tech issues during Zuckerberg’s appearance on Capitol Hill, may genuinely ignore how their websites run.

“Do we believe that politicians themselves are going in and embedding these analytic scripts in their websites? No. Is it someone on their staff? Yes,” said Chandler Givens, chief executive of TrackOFF, a Baltimore company that offers tools to protect people’s identities. “It’s a deliberate action on their part.”

Givens’ company decided to look into website tracking used by candidates in the run-up to the Nov. 6 midterm elections.

“Watching the hearing with Zuckerberg, we started thinking, you know, it’s probably the case that a lot of these folks are using the same type of technology that they are lambasting Mark Zuckerberg for,” Givens said.

As part of a survey in September, the company picked 100 random campaigns, some of incumbent senators and members of Congress, others of challengers, from 35 states. They found that 95 of the campaigns used tracking technology on their websites. Of those, 49 websites did not state that they were collecting data or say for what purpose it would be used. Such perfunctory statements are usually contained in a “privacy policy” link on websites.

The vast majority (84 percent) of sites used Google Analytics, a free tool that tracks activities of users and can sort them by age, location, gender and interests. About half that number (42 percent) used Facebook’s tracking technology.

A handful used less well-known but powerful tracking tools, including ones by AddThis and MediaMath (mathtag), that offer a detailed analysis of a website’s visitors. TrackOFF found at least five politicians or incumbents who used a combination of three tracking tools.

Givens said the less widely known tools offer politicians deeper insights when the data are wedded with offline databases containing information on consumer purchases and other activities.

“That is something that would be jarring to the average reader to know that if you’re buying something at the local pharmacy there’s high probability that that information is being packaged up, shared and sold to data brokers. That information is then connected up with your online browsing habits to form a profile of you which can be used to target you in political campaigns. That’s actually happening now,” Givens said.

As consumers grow warier of tracking, such tools have evolved, said Yinzhi Cao, a computer scientist and privacy expert at Johns Hopkins University in Baltimore.

The early days of tracking saw widespread use of computer “cookies,” or packets of data that keep records of a user’s visits to a website and allow them not to need to log in again repeatedly. As some users deleted cookies, developers ushered in a generation of “super cookies,” which cannot be deleted, and uniquely identify the device a user is on.

Perhaps more pernicious, the latest generation of tracking tools employ digital fingerprinting, which may include a lightning scan of factors like the fonts and plug-ins installed on a device and the way in which it renders an image, all brought together to identify the device, and even the user.

“Some of the tracking companies have become sneakier. That’s why they use advanced tools to track you even if you clear your browser cookies,” Cao said.

One senator who maintains an active campaign website, Sen. Richard Blumenthal, a Connecticut Democrat, immediately removed the Google and Facebook tracking tools from the site when a reporter contacted his office. Blumenthal doesn’t face re-election until 2022.

“Like millions of other consumers, we rely on Facebook and Google’s services and products on a daily basis and have placed trust in how they handle consumer data — a trust that as we have learned over the past year, these companies have repeatedly betrayed,” Blumenthal said.

“While I have taken steps to remove Google and Facebook from my website, such companies have deeply embedded themselves across the Internet. Protecting privacy should not be so difficult, and Congress needs to set the standard.”

Many other legislators and candidates did not respond to repeated phone and email messages for comment, including Rep. Tonko and Democratic Rep. Debbie Dingell of Michigan, both of whom were highly critical of Zuckerberg at the April hearing yet use tracking tools.

Senator-elect Mike Braun of Indiana, a Republican, who uses three tracking tools on his campaign website, did not respond to repeated emails to his office. Nor did Rep. John Faso, a New York Republican, who also uses three tracking tools. A spokesman for Sean Casten, a biochemical engineer who won a House seat from Illinois 6th district, and uses three tracking tools on his site (although with a privacy warning), said he is “focused on his transition” and would not offer comment.

Some experts say data gathering by politicians will only increase.

“Successful campaigns these days use technology to psychographically target their support base and by doing so, can cut to the psychological core of the voter,” said James Scott, a consultant who until recently advised legislators on cybersecurity issues. “The topic of privacy and weaponizing metadata against the user for psychological manipulation is one of the things that burned me out on the Hill.”

Givens, the TrackOFF chief, said he worries that the harvesting of data from tracking tools will prove too tantalizing to politicians to try to curb.

“You have to step back and start thinking about a republic in which the candidates who are elected maybe are the ones who have the most advanced tracking analytics tools at their disposal. Is that the type of government that is the optimal model for the United States?” Givens asked.

©2018 McClatchy Washington Bureau. Distributed by Tribune Content Agency, LLC.

Looking for the latest gov tech news as it happens? Subscribe to GT newsletters.