(Reuters) - China's Alibaba Group Holding Ltd BABA.N reported a better-than-expected 40% rise in second-quarter revenue on Friday, powered by strong growth in its e-commerce and cloud computing businesses.

The results come as the company gears up for its annual Single's Day shopping bonanza this November, and competes increasingly with e-commerce site Pinduoduo Inc PDD.O for sales in China's smaller cities.

The company’s U.S.-listed shares rose more than 2% to $180.25 in trading before the bell.

Alibaba primarily earns income from selling advertising and promotional services to third-party merchants that list products on Taobao and Tmall, two of its e-commerce sites.

Total revenue rose to 119.02 billion yuan ($16.91 billion) in the second quarter ended Sept. 30 from 85.15 billion yuan a year earlier. Analysts were expecting revenue of 116.8 billion yuan, according to IBES data from Refinitiv.

Sales from the company’s e-commerce business rose about 40% to 101.22 billion yuan, while its cloud computing business posted a 64% jump in revenue to 9.29 billion yuan.

The company’s net income attributable to ordinary shareholders rose to 72.54 billion yuan from 20.03 billion yuan a year earlier, due to a one-time gain related to its stake in Ant Financial.

Alibaba, the biggest Chinese e-commerce company and rival JD.com Inc JD.O have been looking to diversify as online sales slow amid saturated markets in China's biggest cities and consumer confidence takes a hit from the ongoing U.S.-China trade war.

For Alibaba, this has meant doubling down on reaching consumers in China’s second- and third-tier cities.

Over the past several years, upstart e-commerce service Pinduoduo attracted many first-time online shoppers with a social, group-buying based app.

To compete, Alibaba has launched a bargain-centric app called Taobao Tejia, and also pushed its existing group-buyins service Juhuasuan to customers.

In an earnings call with analysts, Alibaba CFO Maggie Wu highlighted how the company’s broad range of apps allows it to appeal to a wide range of consumers.

“Average revenue per user (ARPU) in lower tier cities is not as low as people imagine,” said Wu. “I think we have addressed very well in our taobao apps different demands and levels of consumers,” she added.

In the same call, Alibaba chairman Daniel Zhang also referred to the company’s livestreaming efforts, in which sellers take to third-party services such as Douyin and Kuaishou to push products on Taobao and Tmall, as a “new swimming lane for the company.

Zhang said that over 50% of Tmall merchants have by now used livestreaming to reach customers, adding that while the feature has yet to be monetized, updates on a broader business strategy will come soon.

Excluding items, Alibaba earned 13.10 yuan per American Depository Share. Analysts were expecting 10.65 yuan per ADS, according to IBES data from Refinitiv.