Amazon is shutting down a program that sends shoppers free samples based on what it thinks they want to buy.

The program, which Amazon began testing earlier this year, used machine-learning tools to discern shoppers' buying habits, then sent them free product samples curated to their tastes. Samples included items such as Maybelline mascara, Calvin Klein perfume and Kind bars, among other things.

The news was first reported by Business Insider.

While Amazon likened it to the site's product recommendation tools, the program raised privacy concerns among some consumers who have grown increasingly wary of data mining and targeted advertising across the web. Now, Amazon says it is winding down the program.

"Amazon is constantly testing and launching new offerings to innovate on behalf of customers," an Amazon spokesperson told CNBC. "At this time, we have decided to discontinue the sampling program in 2020."

Even though some customers felt the program was creepy, it was an effective way for brands to get their products in front of Amazon shoppers for a nominal fee. Brands who took part in the program paid $2 per sample, on top of the actual cost of each product, Business Insider reported.

It comes as Amazon continues to gain share against Google and Facebook in the digital advertising market. Amazon has started to eat into Google's dominance in search advertising, and it held its first major ad conference in October, signifying just how big the business has grown. At the same time, Amazon boasts rich data on customers' purchasing habits that its rivals don't have.