When an unsafe level of bacteria is detected in the water along a New Jersey beach, an advisory is posted warning swimmers of the increased risk of illness.

Such was the case this week for one bay beach and four ocean beaches in Cape May and Monmouth counties, where samples registered levels of Enterococci — a type of bacteria found in animal and human waste — exceeding the recreational standard.

When under an advisory, the beach remains open to the public. So if you're not willing to risk a dip in the water, you may still let the kids play in the sand as you soak in some rays.

But the closer you get to the water, the better your chances are of interacting with sand that's been tainted with the same type of hazardous bacteria.

"If you're below the high tide line and you've got the water encountering that sand, there's always the potential that the sanded area could be contaminated," said Paul Bologna, director of marine biology at Montclair State University.

The risk to your health, however, is far diminished, he noted — unless you're in the habit of ingesting sand near the water's edge.

Bacteria has a much better shot at impacting a beachgoer in the water, where their mouth, ears, eyes and nose are likely exposed.

"If you're sitting on the sand, the sand isn't necessarily getting in those same orifices," Bologna said. "If you're walking along, it's not bouncing around those areas."

The risk could be greater, and not as hidden, in certain back bay beaches where water fowl leave their waste behind, Bologna said.

According to Dr. Jon Miller, an associate professor at Stevens Institute of Technology in Hoboken, the "residence time" of bacteria is a bit longer on the sand than it would be in the water, mainly because it's not flowing as freely as the waves.

"Even though it stays there longer, it's not as dangerous to us," Miller said.

Advisories typically result from heavy rainfall in an area where birds have congregated, the state Department of Environmental Protection said. As is typically the case, the advisories affecting beaches this week were lifted after one day.

Consecutive days of unsafe bacteria levels would result in a beach closure. Of the nearly 3,400 water samples collected during the 2017 season, bacteria levels met the state standard 97 percent of the time.

Testing is conducted every Monday at approximately 180 ocean and 35 bay monitoring stations along the coast.