The nation's retailers are doing a better job of making their customers happy.

After two years of declining satisfaction, they reversed course during the 2016 holiday shopping season, according to the latest American Customer Satisfaction Index report. Retailers scored 78 out of 100 points, that's up 4.7 percent and an all-time high for the sector.

All six categories covered in this report — department and discount stores, specialty retail stores, supermarkets, drug stores, gas stations, and online retail — improved year over year. But online retail was the clear winner with an ACSI score of 83, up 3.8 percent from 2015. (The report is based on 12,500 customer surveys collected in the fourth quarter of 2016.)

"Shopping online is so easy and convenient and as a result satisfaction is much higher than the brick-and-mortar experience and is playing a big role in putting that pressure on the brick-and-mortar side of retail in terms of sales performance and just getting people into the store," said David VanAmburg, ACSI managing director.

Personal Treatment

Oddly enough, as more people shop online and national retailers close stores, customers who go to the ones that remain open may get better service. If the store isn't crowded and there are no lines at the register, the experience will be more satisfying, VanAmburg told NBC News. Of course, this is not a sustainable business model.

"Long-term this is likely to flip on its head because more layoffs and store closings are coming," VanAmburg said. "Down the road we're going to have lots of consumers who are frustrated that their favorite store in their favorite location is closed and now they have to drive a lot further to get to that store."

Of course, emptier stores are not the only reason for happier customers. The report points out that better service, lower gasoline prices, and food price deflation have also contributed to stronger satisfaction.

While foot traffic is down, customers who go to brick-and-mortar stores are intent to buy and are buying more than in the past, according to the National Retail Federation.

"Basket sizes continue to grow thanks to effective customer service and low competitive prices on everyday items," Ana Serafin Smith, NRF's senior director of media relations, told NBC News. "As consumers continue to evolve the way they shop, retailers will pay attention and modify their strategies to align with the needs and wants of their customer base."

Marshal Cohen, chief industry analyst at the NPD Group, said retailers are focused on dealing with online competition and working harder at "creating a better and more satisfying in-store experience." This includes a sales team that's better trained and making sure popular merchandise is always in stock. The ability to buy-online and pick-up at the store is one example of using technology to improve the brick-and-mortar shopping experience, he told NBC News.

What Are America's Favorite Stores?

Department and discount stores have an overall ACSI score of 78, up 5.4 percent from last year. Dillard's takes first place with an 83, up 4 percent and a new high for the company.

JCPenney which came in second place at 82 had the biggest improvement of any national chain, up 11 percent. The report noted that the reintroduction of appliances, new same-day pickup of online orders and an overhaul of the JCPenney website and app appear to have been successful.

Nordstrom (80) was the only department store to see customer satisfaction decline last year, a drop of two percent.

"Nordstrom seems to be experiencing a challenge — in part, from their own online success," VanAmburg said. "Their website is enormously successful and very satisfying and that's putting some pressure on their ability to keep the brick-and-mortar side running at the high level that is has traditionally."

Kohl's, Macy's and Target all saw satisfaction increase, but still scored 79. Sears gained eight percent to score a 77. Satisfaction at Walmart soared nine percent, but the company still took the bottom spot at 72.

"Walmart made a concerted effort on service during the holiday shopping season and created the 'holiday helpers' program to really ratchet-up their ability to provide service and it seems that really paid off," VanAmburg said. "But almost everyone is making gains as well and that keeps Walmart lagging behind in the overall ratings."

Top-Rated Specialty Stores

Costco was the top-rated specialty store, scoring an 83, up two percent from last year, beating Sam's Club (81, up 7 percent) and BJ's Wholesale (79, up four percent).

"Costco is to brick-and-mortar what Amazon is to the online experience," VanAmburg said. "They do what they do very well. They put their money into great staffing, competitive prices and they get you in and get your out and help you find what you're looking for."

Last week, Costco announced that it was increasing its annual membership fees effective June 1. Memberships in the U.S. and Canada will be $60, up $5. Executive memberships will go up by $10 to $120. VanAmburg told NBC News he's interested to see if that hurts customer satisfaction in next year's report.

Supermarkets Show Big Gains

Falling food prices — combined with higher quality products and better customer service — boosted scores for most supermarkets. The industry average of 78 is up 6.8 percent from 2015. Trader Joe's (86) took the top spot, followed by Publix (84).

ALDI, H-E-B and Wegmans tied at 83. Wegmans, last year's top-rate supermarket, dropped three percent this year — the only chain to experience a decline in satisfaction. Whole Foods (81) saw an 11 percent rebound. Giant Eagle and Walmart (74) came in at the bottom, even though their scores jumped 10 percent.

Internet Champions

For many Americans, the Internet is the preferred way to shop — and satisfaction rose another 3.8 percent to 83. That's five points higher than the overall score for retail shopping.

Once again, Amazon is the online leader, capturing the majority of the sales growth in the U.S. and earning the highest ACSI score: 86, up four percent. That's three points higher than the industry average. Other sites: Tech-focused Newegg (83), eBay (81) and Overstock (79). Netflix, which is rated in this category, also scored a 79.

Today's customers want speed and convenience and the Internet delivers on both.

"The ease of payment and steady improvements to product images, and a variety of merchandise keeps shoppers very happy with e-commerce websites," the report noted. "Merchandise is rarely out of stock and there are numerous shipping options to suit each individual buyer."