Then, as he visited other Web sites, he started seeing advertisements asking him to donate to Mitt Romney’s campaign. One mentioned family values, he said, and seemed aimed at someone with more conservative leanings.

“It doesn’t make any sense,” Mr. Goddard said. “I’m the opposite of a Romney supporter. But ever since I went to the Romney site, they’ve been following me.”

One of the hallmarks of this campaign is the use of increasingly sophisticated — but not always accurate — data-mining techniques to customize ads for voters based on the digital trails they leave as they visit Internet sites.

It is a practice pioneered by online retailers who work with third-party information resellers to create detailed portraits of consumers, all the better to show them relevant marketing pitches. Mr. Goddard, for example, may have received those Romney ads because of “retargeting” software designed to show people ads for certain sites or products they have previously viewed.

Now, in the election’s final weeks, both presidential campaigns have drastically increased their use of such third-party surveillance engines, according to Evidon, a company that helps businesses and consumers monitor and control third-party tracking software.

Over the month of September, Evidon identified 76 different tracking programs on barackobama.com — two more trackers than it found on Best Buy’s Web site — compared with 53 in May. It found 40 different trackers on mittromney.com last month, compared with 25 in May.

Photo

Thomas Goddard, of Santa Clara, Calif., says online ads for Mitt Romney have continued to appear since he visited the candidate’s Web site.Credit
Jason Henry for The New York Times

The report provides a rare glimpse into the number of third-party tracking programs that are operating on the campaign Web sites — as many as or more than on some of the most popular retailers’ sites.

The campaigns directly hire some companies, like ad agencies or data management firms, that marry information collected about voters on a campaign site with data about them from other sources. But these entities, in turn, may bring their own software partners to the sites to perform data-mining activities like retargeting voters or tracking the political links they share with their social networks.

Now some consumer advocates say the proliferation of these trackers raises the risk that information about millions of people’s political beliefs could spread to dozens of business-to-business companies whose names many voters have never even heard. There is growing concern that the campaigns or third-party trackers may later use that voter data for purposes the public never imagined, like excluding someone from a job offer based on his or her past political affiliations.

Evidon offers a free software program called Ghostery that people can use to identify third-party trackers on the sites they visit. On Oct. 18 the program identified 19 different trackers on the Obama Web site and 12 on the Romney site. A reporter contacted 10 for comment.

Among those who responded, Cassie Piercey, a spokeswoman for ValueClick, whose MediaPlex marketing analytics division was identified as operating on the Obama site by Ghostery, said she could not comment on specific clients and referred a reporter to the company’s privacy policy. The policy says that ValueClick may collect information about users — like their Internet Protocol addresses, Web browsing histories, online purchases and searches — that does not involve identifiable information like their names, and that the company may share that data with its clients and marketing partners.

Adam Berke, the president of AdRoll, an advertising and retargeting company identified by Evidon on the Obama site, said the company did not aggregate user data or share it with other clients.

Photo

A program called Ghostery shows the tracking software at the campaign sites of President Obama and Mitt Romney.

Meanwhile, Nanda Kishore, the chief technology officer of ShareThis, a service found on the Romney site by Ghostery that collects information about the links visitors share with their social networks, said the company collects only “anonymous” information about users and does not share or sell it.

The privacy policies on the campaigns’ Web sites acknowledge that they work with third parties that may collect user data.

Evidon executives said the tracking companies on the campaign sites included services that collect details about people’s online behavior in order to help mold ads to their political concerns; advertising networks that track people’s browsing history to measure the effectiveness of ads; and companies that record user behavior so they can analyze the effectiveness of sites to attract and hold on to Web traffic.

Officials with both campaigns emphasize that such data collection is “anonymous” because third-party companies use code numbers, not real names, to track site visitors.

Adam Fetcher, a spokesman for the Obama campaign, said the Web site does not allow its partners to share data collected from visitors with other clients or use it for other purposes like marketing consumer goods.

“We are committed to protecting individual privacy and employ strong safeguards to protect personal information,” Mr. Fetcher wrote in an e-mail. “We do not provide any personal information to outside entities, and we stipulate that third-party partners not use data collected on the site for other purposes.”

In response to a reporter’s query about whether the Romney site placed limitations on the collection or use of voter data by its partners, Ryan Williams, a campaign spokesman, wrote in an e-mail: “The Romney campaign respects the privacy rights of all Americans. We are committed to ensuring that all of our voter outreach is governed by the highest ethical standards.”

Photo

Mitt Romney's campaign Web site.

Evidon compiled the statistics on campaign tracking by aggregating data from a panel of about seven million volunteers who use its Ghostery program.

From May to September, Evidon identified 97 tracking programs — “far more than the average site employs,” a company report said — on the Obama and Romney sites combined. (Some trackers appeared on both sites.)

The campaigns’ increased use of tracking technology represents “a significant windfall for online data collectors and ad targeting companies,” Andy Kahl, the director of consumer products at Evidon, wrote in the report. But, he added, “the campaigns need to realize that being on top of which technology partners are appearing on their site, and ensuring clarity into what these partners can and can’t do with the data, is essential.”

Industry executives say the campaigns simply use data-mining to show the most relevant message to each voter.

“Political campaigns now for the first time can actually reach out to prospective voters with messaging that addresses each person’s specific interests and causes,” according to a recent report from the Interactive Advertising Bureau, a trade group.

But privacy advocates say such personalization raises questions about transparency.

“Individual voters may not be aware that the message they are getting is based on information that has been gleaned about their activities around the Web and is precisely targeted to them,” said Mr. Calabrese of the A.C.L.U. “It may be a private message just for me that is not the type of statement the campaign makes publicly.”

While some voters may be turned off by the customized campaign appeals, for others, they are expected.

“Companies are doing it, why shouldn’t campaigns?” said Michael James, a New Jersey high school teacher who visited both campaign sites this year to determine whom he would support. “The Internet has changed privacy. We can’t expect either campaign to pretend we’re living in the past.”

A version of this article appears in print on October 28, 2012, on page A16 of the New York edition with the headline: Tracking Clicks Online To Try to Sway Voters. Order Reprints|Today's Paper|Subscribe