Shares of Baidu (BIDU -0.69%) recently rallied after its fourth-quarter earnings topped Wall Street's estimates. The Chinese tech giant's revenue rose 22% annually to 27.2 billion RMB ($3.96 billion), beating expectations by $80 million. Excluding its upcoming divestments, Baidu's revenue went up 28% annually.

Its non-GAAP net income fell 22% annually to 4.1 billion RMB ($589 million), or $1.92 per ADS, but beat expectations by $0.16. On a GAAP basis, its net income declined 50% to 2.1 billion RMB ($303 million), or $0.86 per ADS.

A young man uses a smartphone.

Image source: Getty Images.

Revenue at Baidu Core -- which excludes iQiyi (IQ) and its other noncore businesses -- jumped 14% annually to 20.5 billion RMB ($2.98 billion), or 20% excluding its divestments. Its core non-GAAP net income dipped 1% to 6.5 billion RMB ($939 million).

For the first quarter, Baidu expects its revenue to rise 12%-18% annually on a reported basis and 18%-24% after excluding its divestments. Analysts expect Baidu's revenue to go up 18% on a reported basis, and for its non-GAAP earnings to fall 40%.

Baidu's earnings and guidance weren't that impressive, but analysts' expectations were low due to the economic slowdown in China. So should value-seeking investors buy shares of Baidu, which has lost about a fifth of their value over the past six months?

The key numbers

Baidu's online marketing revenue spiked 10% annually and accounted for 78% of its top line. Its number of active online customers rose 15% to 529,000, but its revenue per online customer declined 4% to 40,100 RMB ($5,800). Here's how those figures compared to its growth over the past year:

Metric Q4 2017 Q1 2018 Q2 2018 Q3 2018 Q4 2018
Online marketing revenue 26% 23% 25% 18% 10%
Active online customers 2% 5% 9% 7% 15%
Revenue per online customer 25% 19% 16% 12% (4%)

Year-over-year growth. Data source: Baidu quarterly reports.

The only bright spot was Baidu's growth in active online customers, but it benefited from a fairly easy comparison to 2% growth in the prior-year quarter. Meanwhile, its decline in revenues per customer is worrisome, and indicates that marketing budgets are being squeezed by the economic slowdown.

Baidu's operating margins also contracted across the board, mainly due to higher channel and promotional marketing efforts, personnel related expenses, content acquisition costs for iQiyi, and the expansion of its ecosystem.

Operating margins Q4 2017 Q4 2018
Total (GAAP) 21% 4%
Total (non-GAAP) 26% 10%
Baidu Core (GAAP) 33% 22%
Baidu Core (Non-GAAP) 38% 28%

Data source: Baidu quarterly reports.

But here's some good news...

Decelerating sales growth and contracting margins will remain major headwinds for Baidu throughout 2019. But investors shouldn't ignore the longer-term tailwinds.

Baidu's traffic acquisition costs (TAC) rose 34% annually, but accounted for just 13% of its total revenue and 16% of its online marketing revenue. This indicates that the company isn't aggressively spending cash to lock in users, since it controls over 70% of China's online search market and remains the top online ad platform.

By comparison, Baidu's smaller rival, Sogou (SOGO), which controls just 5% of the search market, spent 50% of its revenue on TAC in its latest quarter. Alphabet's Google, which briefly flirted with a return to China, spent 23% of its ad revenue on TAC last quarter.

Baidu's ecosystem is also rapidly expanding. The Baidu App's daily active users (DAUs) rose 24% annually to 161 million. The app's Smart Mini Programs, which are similar to Tencent's (TCEHY -1.14%) WeChat Mini Programs, grew its monthly active users (MAUs) 30% sequentially to 147 million. Its new short video app Haokan, which is aimed at countering ByteDance's TikTok, also hit 19 million DAUs -- up from just 1 million a year earlier.

Check out the latest Baidu earnings call transcript.

Baidu's Xiao Du Home 1S smart speaker.

Baidu's Xiao Du smart screen. Image source: Baidu.

Baidu's Alexa-like DuerOS virtual assistant reached an installed base of 200 million devices, representing 45% growth from the previous quarter. That base -- which includes smart speakers, cars, and other connected devices -- expands Baidu's reach beyond PCs and mobile devices and widens its moat against Tencent and Alibaba.

Lastly, Baidu will likely loosen its grip on iQiyi as it evolves as a stand-alone company. This means that Baidu should eventually spend less cash acquiring content for the platform, which hit 87.4 million subscribers at the end of 2018 and is aggressively competing against Tencent Video for the top spot in China's video streaming market.

So is it time to buy Baidu?

Though Baidu is definitely feeling the impact of the economic slowdown in China, it should also retain its lead in the online search and advertising markets. The expansion of its ecosystem will also help it lock in more users and open up new avenues of long-term growth.

Baidu's forward P/E of 17 also makes it the cheapest of the three "BAT" stocks. Alibaba and Tencent, the other two members of that triumvirate, trade at 26 and 29 times forward earnings, respectively. The bears will claim that Baidu is cheap for a reason, but I think its downside is limited at these levels and it remains a solid long-term play on the Chinese tech market.