Facebook is wishing some of its "Jewish" users a Happy New Year.

Rosh Hashanah, the Jewish New Year, began Wednesday evening -- and some Facebook users received a celebratory message when they logged in.

"Happy New Year! All of us at Facebook wish you a sweet and happy new year."

While the note was well received by some, others questioned how exactly the social network was aware of their religious affiliation. In some cases, Facebook users who aren't Jewish were also served the message.

"Dear Facebook, I appreciate the well wishes. But I'm not Jewish," tweeted one user.

Mauricio Sadicoff, a Jewish software engineer living in Illinois, also received the message, despite the fact that his profile doesn't list a religion.

"I have posted about Chanukah in past years, so maybe that?" he asked.

This is creepy in many levels... I don't have any religion listed on my profile and Facebook just wished me a happy Jewish new year. — Mau Sadicoff (@tatonka) September 21, 2017

So what gives?

Not surprisingly, the social media giant collects troves of data on its users. If you've ever clicked on ads -- for a retailer or a fashion designer -- or posted updates about political topics, the shows you're watching or holidays, the company pulls that data into your ad preferences page. (Want to see what Facebook thinks it knows about you? Take a peek here).

That information is categorized to "help advertisers reach people who are most likely to be interested in their products, services, and causes," Facebook states on the ad page.

In addition to using the information people have provided on Facebook, the company also says it tracks "other activity."

The categories listed on user accounts can get very specific, such as "close friends of expats," "away from family," and "returned from travels 1 week ago," as well as more generic ones like "millennial." (The company also appears to be testing a tool that lets users hide ads for alcohol and parenting, either temporarily or permanently.)

Related: Facebook says it will hand Russian ads over to Congress

"We send messages about religious moments to people in countries where a large proportion of the population observes the religion, or where the religious date is a public holiday," a Facebook spokeswoman said in a statement. "We may also show the message to people who've expressed interest in the holiday. We celebrate the most widely-observed moments across the major religions represented in our global community."

Siva Vaidhyanathan, a media studies professor at the University of Virginia, said the Rosh Hashanah messaging is another example of the extent to which Facebook is tracking us.

Related: Sheryl Sandberg 'disgusted' by anti-Semitic ad targeting

The timing of the message is particularly notable. Last week, a ProPublica report revealed that Facebook let advertisers target users using terms like "jew hater."

Hours before Facebook pushed out the Rosh Hashanah message, Facebook COO Sheryl Sandberg said she was "disgusted and disappointed" that Facebook was helping advertisers target anti-Semitic users.

"Many of my friends expressed the understandable concern about Facebook compiling a list of Jews," Vaidhyanathan told CNN Tech. "It seems like a really odd moment to be doing that and declaring one's ability to do that. This seems so politically tone deaf at this moment."

Related: Facebook handed Russia-linked ads over to Mueller

Bernard E. Harcourt, professor at Columbia University and author of Exposed: Desire and Disobedience in the Digital Age, called it an "aggressively intrusive move."

It's unclear whether this is the first time Facebook has sent a Rosh Hashanah message to Jewish users. The company did not immediately respond to a request for comment.

Facebook may be well-meaning, but it's important to consider the other reasons that Facebook is targeting users with Rosh Hashanah messaging.

"I'm not saying it is, but it would be a kind of brilliant and perfect way to test your algorithms," Harcourt said.

In other words, as Facebook users respond with comments like "I'm not Jewish but thanks anyways," or "How did Facebook know I'm Jewish?" -- the social network can further validate what it knows.

"If you do want to target Jews for advertising, now you've got a much sharper and better algorithm as a result of the corrections that were made," Harcourt said.