China's online advertising market has either been a minefield or a goldmine over the past year, depending on which companies you've invested in.

For Baidu (NASDAQ:BIDU), which owns China's top search engine, it was clearly a minefield. Baidu's advertising revenue dropped year-over-year for six straight quarters; it broadly attributed its woes to China's economic slowdown, the ongoing trade war, the pandemic, and intense competition.

But for Tencent (OTC:TCEHY), which owns China's top mobile messaging platform WeChat, it was a goldmine. Tencent's ad revenue rose 16% year over year in the third quarter, accelerating from its 13% growth in the previous quarter and leaving legacy players like Baidu in the dust.

Two young women take a selfie.

Image source: Getty Images.

So why is Tencent's ad business flourishing while Baidu and other ad companies struggle? Let's discuss the two main reasons.

1. WeChat is locking in mobile users

WeChat, known as Weixin in China, served 1.21 billion monthly active users last quarter. WeChat was originally a simple messaging app, but its introduction of mini programs in 2017 turned it into a mobile superpower.

Mini programs are lightweight apps that let WeChat users shop, order food, play games, hail rides, make payments, and more without ever leaving the main app. WeChat's total number of mini programs rose from 2.3 million in 2018 to 3.2 million in the first half of 2020, according to Daxue Consulting.

Tencent also expanded WeChat as a social network with Moments, which lets users share posts with a circle of close friends, and it launched an internal search engine for WeChat posts. In other words, Tencent turned WeChat into the default gateway for all online activities, which pulled users away from stand-alone search engines like Baidu.

That's why Tencent's "social and others" ad revenue rose 21% year over year last quarter and accounted for 83% of total ad revenue. Macro headwinds caused many companies to buy fewer ads from companies like Baidu, but they still seemed to prioritize ad purchases on WeChat and its mobile ad network.

2. Attracting pandemic-resistant advertisers

The pandemic initially throttled ad purchases from the travel, auto, and real estate sectors. Tencent and Baidu both struggled with that slowdown, but pandemic-resistant companies in the e-commerce, online education, gaming, and internet services sectors all ramped up their ad spending on Tencent's platforms while seemingly avoiding Baidu.

A young girl takes an online class on a laptop.

Image source: Getty Images.

This schism can be seen across China's entire advertising sector. Tencent, the Gen Z darling Bilibili, and TikTok owner ByteDance all generated robust ad sales throughout the crisis. Baidu and SINA, which owns a network of portal sites and Weibo, did not.

That split indicates advertisers see more value in Tencent's ads. Tencent's eCPM (effective cost per thousand impressions, or the average cost of its ads) rose last quarter, thanks to higher sales of video ads, indicating it still has plenty of pricing power in the crowded advertising market.

Tencent's steady sales of ads to pandemic-resistant sectors buoyed its business throughout the crisis and offset soft demand from the more afflicted sectors. It also offset its declining media advertising revenue (mainly from Tencent Video and Tencent Music), which accounted for the remaining 17% of its total ad revenue last quarter.

Last quarter, the company said its ad sales to the auto and real estate sectors were rebounding, and its media ad sales were stabilizing. Those improvements, along with healthy demand from pandemic-resistant advertisers, should cause Tencent's ad revenue growth to accelerate again in the fourth quarter and beyond.

The key takeaway

Tencent's advertising segment generated 17% of its top line last quarter, and it's still one of the company's core growth engines alongside its gaming, social networking, fintech, and cloud businesses.

WeChat and its mobile ad network should remain top platforms for China's fickle advertisers, even as Baidu desperately tries to catch up by launching similar mini programs for its mobile app. In other words, the advertising market will continue to be a goldmine for Tencent.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.