Tencent (TCEHY 0.10%) is one of the largest tech companies in China. It owns WeChat, the country's top messaging app; the world's largest game publishing business; China's second-largest cloud platform; one of the country's largest video streaming platforms; and one of its top digital payment platforms.

Tencent's stock has rallied more than 1,400% over the past decade as its gaming and advertising businesses expanded and it entered new markets. Is it finally time to take profits, or does the Chinese tech giant still have room to run?

Tencent Building and Shenzhen University.

Image source; Getty Images.

Keeping pace with shifting advertising trends

Tencent's advertising business, which generated 19% of its revenue last quarter, sells ads across WeChat, the older QQ messaging platform, its mobile ad network, Tencent Video, and other apps. The segment's revenue rose 32% annually during the quarter as e-commerce, online education, and gaming companies bought more ads throughout the COVID-19 crisis.

However, Tencent's ad business faces fierce competition from Alibaba's (BABA 0.28%) paid product listings, online search platforms like Baidu (BIDU -0.56%), and Gen Z-oriented platforms like ByteDance, which owns the viral short video app TikTok (known as Douyin in China).

WeChat's ecosystem of Mini Programs, which locks users into the app, also faces competition from similar walled gardens like Baidu's mobile app, Alibaba-backed AliPay, and Douyin's mini programs. WeChat's messaging service, which serves over 1.2 billion monthly active users, also faces competition from dating apps like Momo and Tantan.

To shore up its defenses against these rivals, Tencent needs to keep launching new apps -- which will cause its operating expenses to rise.

The gaming unit is relying on overseas growth and investments

Tencent's gaming business, which generated 35% of its revenue last quarter, is still locking in gamers with hit games like Honor of Kings, Peacekeeper Elite, PUBG Mobile, and League of Legends. Its revenue grew 31% annually during the quarter as people played more games throughout the lockdown period.

A young gamer plays a mobile game.

Image source: Getty Images.

Tencent's stakes in overseas companies like Fortnite publisher Epic Games, Bayonetta developer Platinum Games, Ubisoft, and Activision Blizzard also reduce its dependence on the Chinese market, which is hobbled by fickle censorship standards, tight playtime restrictions, and rigid licensing requirements.

That expansion also widens its moat against its top Chinese rival NetEase, which is gaining significant momentum overseas with its PUBG rival Knives Out.

Looking ahead, investors should expect Tencent's gaming unit to rely more heavily on overseas titles like Call of Duty Mobile, as well as increased investments in overseas developers and publishers.

Countering Alibaba in the cloud and fintech markets

Tencent's fintech and business services unit, which accounted for 24% of its top line last quarter, generates most of its revenue from Tencent Cloud, China's second-largest cloud infrastructure platform after Alibaba Cloud, and WeChat Pay, which shares a near-duopoly in the payments market with Alibaba-backed AliPay.

Revenue from this newer business rose 22% annually last quarter, but that marked a significant slowdown from its previous quarters. Tencent attributed the deceleration to fewer WeChat payments throughout the lockdowns, but it expects the business to recover later this year.

Tencent doesn't disclose its cloud profits, but it's likely unprofitable like Alibaba Cloud. Both companies will likely incur more losses in their cloud businesses, and use other profitable businesses -- like Tencent's ad and gaming units, and Alibaba's core commerce unit -- to subsidize the difference.

Therefore, the growth of the fintech and business services unit is a double-edged sword: It generates fresh revenue growth and diversifies Tencent's top line away from games and ads, but it will likely throttle its adjusted operating margin -- which declined annually from 43% to 34% last quarter.

Is it the right time to buy Tencent?

Analysts expect Tencent's revenue and earnings to rise 22% and 17%, respectively, this year, as its strengths offset its weaknesses. That's a solid growth rate for a stock that trades at about 33 times forward earnings.

I own shares of Tencent, and I believe it's still one of the best long-term plays on China's growth. Tencent is also better diversified than Alibaba and Baidu, which still rely heavily on e-commerce sales and online ads, respectively.

The only near-term threat to Tencent is the legislative threat to potentially delist Chinese stocks from U.S. exchanges if they don't follow certain accounting rules. But top tech companies like Tencent, Alibaba, and Baidu will more likely reach a compromise with U.S. regulators instead of staging a full retreat to closer exchanges like Hong Kong. Therefore, Tencent remains a solid long-term investment, and it has room to run after its 30% rally over the past 12 months.