SAN FRANCISCO — The dream of online shopping is never having to brave store parking lots, long lines or empty shelves. The reality, at least some of the time, is coming home to an empty box or no box at all.

More than half of Americans say they know someone who’s had a package stolen from outside their home, and 30% say they’ve experienced it themselves, according to a new survey by Xfinity Home, Comcast’s home security service.

As the holiday count-down begins, consumers face a tradeoff between convenience and the risk of letting expensive goods sit out in the open for anyone to snatch. That’s prompted some unusual work-arounds from consumers and increased the incentive for delivery services, home-security providers and some police departments to find ways to crack down on package thefts.

Roger Nyhus’ gardener was working in his Seattle yard when a young man calmly walked up the steps to the house and stole a just-delivered package from the front porch.

The gardener “dropped her pruners and ran after the guy and he dropped the box,” Nyhus said.

Nyhus wishes, for the gardener’s safety, that she had let the thief go. But he found the incident changed his buying behavior.

“Now I have all my personal stuff delivered to my office,”  said Nyhus, who runs a public relations company called Nyhus Communications. “It kind of defeats the purpose of delivery.”

Of the  nearly one-third of shoppers who’d had a package stolen, last week’s Xfinity Home survey found city dwellers experienced 42% of thefts. That compared with 26% in the suburbs and 19% in rural areas the survey, conducted by market research firm Wakefield Research, found.

Fighting theft

Most retailers deal with the problem by routinely re-sending products reported as undelivered with few questions asked. This appears to be Amazon’s unofficial practice, though the company would not comment about it on the record.

This month it also launched Amazon Key, a program that allows Prime customers to install an electronic lock so delivery personnel can open it to drop packages inside, tied to a security camera that sends footage of the delivery — and the exit — to the customer.

More: New Amazon Key lets the delivery driver leave packages inside the front door

It’s similar to a service Walmart began testing in September in which drivers not only drop packages inside but will also put the groceries away.

Amazon and others also offer lock boxes where users can go for pickups. In addition, UPS and FedEx both have programs that allow customers to re-route packages to their offices or another site for safe pickup. They also allow customers to have packages delivered to nearby stores.  These services are useful for people who aren’t home to take delivery of a package.

How much care drivers take with their deliveries varies in the experience of Wendy Robushi, an artist in San Francisco. She says her UPS driver always rings the bell and leaves a note, but she hasn’t been as impressed with the no-insignia white vans that sometimes bring Amazon orders.

“I’ll look out my window and there’s my package sitting down at the bottom of the stairs but they didn’t even bother to ring the doorbell,” she said.

With e-commerce sales representing up to 9.1% of total retail sales, according to the U.S. Department of Commerce, delivery companies are eager to find solutions that make shoppers feel more secure buying online.

Worries about theft are holding some back. A survey by Shorr Packaging Corp. this year found that 41% of respondents don’t buy certain things online because they’re afraid the packages will get stolen, with electronics being at the top of the list.

Video deterrence

Home security systems, such as those from Xfinity Home, Ring doorbell, Nest and others, are promoted as one way to have peace of mind for home deliveries.

Police departments don’t agree on whether they help.

The Philadelphia Police Department figures it’s a boon. It posts videos of almost every crime where they’re available, said Det. Linda Longo.

“You never know who’s going to recognize the person. Then if we get that person’s ID, we put out a warrant for their arrest,” she said.

In Houston, police on several occasions have used surveillance footage to track serial package thieves.

Spokeswoman Jodi Silva said they’ve had instances of thieves “going from house to house to house. They may be following a UPS truck. They’ll just jump out, see if there was a delivery and grab it,” she said.

But in California, Capt. Gary Berg with the Campbell police department isn’t convinced. He could only think of one example of a thief being identified based on surveillance images and then arrested.

“People who are relying on the camera to protect their packages are probably kidding themselves,” he said.

Instead, the small Silicon Valley suburb decided a few years ago to take matters into its own hands. It now leaves out “bait” packages containing expensive items with GPS locators hidden inside of them on volunteers’ porches.

As soon as a package is moved, the dispatch center gets an alert and officers track them. They’ve had multiple arrests.

“We wanted the word to get out that any package in Campbell could be a bait package,” said Berg.

The community’s been pleased with the outcome, though concerns were raised about whether the would-be thieves’ privacy was being invaded.

Berg squelched that. “There is no expectation of privacy when you’re taking something that doesn’t belong to you,” he said.