Social media giant Facebook has reported revenue beating expectations but experienced a decline in its number of active users in the United States and Canada over the past several months.

The company generated a little under $US21.5 billion ($A30.7 billion) in third quarter revenue, the vast majority of it from online advertising.

The amount represents a 22 per cent increase year-over-year.

Facebook’s chief financial officer noted the increase in ad revenue was likely spurred by the coronavirus pandemic, which has moved much of the retail industry online.

“We believe the pandemic has contributed to an acceleration in the shift of commerce from offline to online, and we experienced increasing demand for advertising as a result of this acceleration,” the company said in a statement on Thursday.

Facebook boosted revenue despite coming under fire for its attempts to regulate political advertising and election-related content and despite an advertising boycott in July.

Last quarter, Facebook announced it reached three billion monthly users across all its apps, which include Facebook, Instagram, WhatsApp and Facebook Messenger.