The best way to avoid great white shark attacks in Cape Cod waters is to figure out where the sharks like to hang out and when they are there, marine biologists said Tuesday.

Experts from the state of Massachusetts and the nonprofit Atlantic White Shark Conservancy held a news conference in Chatham to outline some of the ways they are trying to detect patterns in shark movement and habits.

The goal is to keep beachgoers informed and safe.

“It's no secret that the number of negative interactions between people and sharks has been increasing," said Greg Skomal, the top shark expert with the state Division of Marine Fisheries.

The last fatal shark attack in state waters occurred in September 2018 when a man boogie boarding off Wellfleet was killed.

Sharks are drawn to the region by an abundance of seals, their favorite meal, but people can sometimes get in the way.

Sharks start migrating to the area in May, with peak activity in August, September and October, although white sharks have been detected in area waters as late as Dec. 17, said Megan Winton, staff scientist at the conservancy. Nearly half of their time is spent in waters less than 15 feet (4.5 meters) deep, close to shore, she said.

The sharks are tracked in a variety of ways, including with acoustic tags.

There are currently 179 sharks fitted with acoustic tracking tags, and when they get within about 500 meters of a receiver, the receiver records the date and time, Skomal said.

There are also five real-time receivers deployed along the Outer Cape, the area that faces east toward the Atlantic Ocean where sharks are most active. As soon as these real-time receivers detect a shark, the information is relayed to public safety officials, including lifeguards on the beaches who can clear the water.

But Winton warned that the system can only detect sharks that are tagged, so there is a possibility that an untagged shark will move close to shore without the public knowing.

The public can also check the conservancy’s sharktivity app to track shark sightings.

“At the heart of all of this, it is really all about people," Winton said. “We're learning all this information so we can provide it to the public and provide it to the people, so that they can modify their behavior to proactively reduce the risk of having a bad interaction with a great white."