Some health media websites share users' search terms with outside companies that track consumers and target advertising, according to a new study.

Dr. Marco Huesch, from the University of Southern California in Los Angeles, used interception software and found seven out of 20 popular health sites passed search information to third parties.

"Most of the time this may be harmless. You may be getting ads that are customized or tailored to you and you can just ignore them," said Kasisomayajula Viswanath, who studies health behavior and communication at the Harvard School of Public Health in Boston.

But, he said, "Given that a lot of people are unaware of how their data are being tracked… if these data are leaked, there are some serious consequences."

Those could include embarrassment or real harm if patients are discriminated against based on their medical searches, said Viswanath, who wasn't involved in the new research.

For his study, Huesch downloaded free privacy tools and purchased and installed interception software, which picks up hidden traffic to third party websites. Then he visited the 20 health sites and searched for "depression," "herpes" and "cancer."

U.S. government sites including the National Institutes of Health and the Food and Drug Administration web pages did not share search information, nor did four out of five sites directed toward doctors, Huesch found.

But other popular consumer websites, such as Men's Health and Health.com, did share search terms with third parties, according to the findings published Monday in JAMA Internal Medicine.

"It's a very small study but it raises extremely important questions about online privacy," Viswanath said.

"If someone is watching me on the (computer) screen or entering a shop to buy medication or entering a clinic to get some testing done, then I notice the physical presence of that person. But electronic tracking is not noticeable, which makes it all the more insidious."

The study could not show whether the search data were used for more than targeting advertisements.

But Huesch pointed out that consumer information "has a lot of value" to marketers and manufacturers.

"These things aren't done for free. The people that invest in this third party data are sophisticated technology companies," he said.

"At the end of the day, these tools are being used in ways that are pretty unsavory and creepy."

For example, he said, an insurance company could use search data to discriminate by not advertising offers to someone who has searched for information on depression.

On its website, Rodale, which publishes Men's Health, states that it "may make certain PII (personal identifying information) and other information available to trusted third parties that work with us to provide products and services to our customers, that help us with marketing campaigns, or that intend to market products and services to you directly. These companies are obligated to protect the information they receive."

In an email, a Men's Health spokesperson said, "User privacy is important at Men's Health, as well as at all of our brands company-wide. We don't record user searches. Visitors always have an opt out option on our site, and we carefully screen marketing partners to ensure readers only see information that is reliable and useful."

Health.com did not respond by press time to a request for comments.

Viswanath said people searching for medical information online should not assume they are anonymous and take privacy for granted. They can be extra careful, he said, by sticking to U.S. government sites for health-related searches, for example.

"You have to take precautions if you're online," Huesch said. "That's just a fact of life."