Optimizing Meituan Scan‑to‑Pay Mini Program: Reducing Package Size and Boosting Conversion Rates

Meituan Scan-to-Pay mini program optimized by reducing package size through split and independent sub‑packages, moving assets to CDN, and adding detailed funnel, exception, performance, and cross‑boundary timing monitoring, which together increased external conversion by about 3 % and improved overall payment success rates.

Meituan Technology Team
Meituan Technology Team
Meituan Technology Team
Optimizing Meituan Scan‑to‑Pay Mini Program: Reducing Package Size and Boosting Conversion Rates

Meituan’s Scan‑to‑Pay mini program provides offline payment services through a WeChat mini program. Users scan a merchant’s QR code, the mini program is launched, and the payment page is displayed for amount entry.

The core business metric is the payment conversion rate – the proportion of users who successfully complete payment. Data analysis revealed two major loss points: the external funnel (scan → mini program launch) and the internal funnel (mini program → payment).

External Funnel Issues

The external funnel is controlled by WeChat and includes fetching mini‑program metadata and downloading the code package. Failures or long wait times cause users to abandon the flow.

Package‑size Optimization

Introduce split‑package loading so that only required code is downloaded on first use.

Reduce the main package from ~3 MB to ~300 KB and create a 61 KB split package, cutting the total size to 361 KB.

Move large binary assets and Base64 images to CDN, and relocate removable business logic to separate sub‑packages.

These changes improved the external conversion rate by about 3 %.

Independent Sub‑Package Concept

Meituan proposed an “independent sub‑package” where the user does not need to download the main package at all; only a 61 KB sub‑package is loaded during the update phase. The feature is currently in a gray‑release stage.

Internal Funnel Monitoring

To address losses in the internal funnel, Meituan established comprehensive monitoring:

Business Core Flow Monitoring : Decompose the payment process into key actions (scan → page display → click pay → order init → payment success) and define metrics such as scan‑load conversion and click‑through rates, forming a funnel for quantitative analysis.

Exception Monitoring : Capture failures of page APIs (e.g., wx.request fail callbacks) and set custom timeout handling (default 60 s, with a 5 s custom timeout for critical calls).

Performance Monitoring : Measure white‑screen time (onLoad → onReady) and interactive time (onLoad → data request completion → pay button enabled).

Additional optimizations include merging multiple network requests into a single call and adding retry mechanisms for both custom API failures and WeChat API errors. Retry counts are controlled by a global configuration and require user interaction after each attempt.

Cross‑Boundary Timing Monitoring

WeChat provides a scancode_time query parameter indicating the server‑side timestamp of the QR‑code scan. By comparing this with the client‑side timestamp captured on onLoad, Meituan calculates:

Page white‑screen latency (client render time – server scan time + network offset).

User‑interactive latency (page ready time – server scan time + network offset).

These fine‑grained metrics enable precise identification of performance bottlenecks.

Conclusion

Through package splitting, independent sub‑packages, detailed funnel metrics, exception handling, and cross‑boundary timing analysis, Meituan significantly improved both external and internal conversion rates of its Scan‑to‑Pay mini program. The team continues to iterate on these practices and shares findings with the broader developer community.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

WeChat Mini ProgramFront-end MonitoringMeituanpackage splittingconversion rate
Meituan Technology Team
Written by

Meituan Technology Team

Over 10,000 engineers powering China’s leading lifestyle services e‑commerce platform. Supporting hundreds of millions of consumers, millions of merchants across 2,000+ industries. This is the public channel for the tech teams behind Meituan, Dianping, Meituan Waimai, Meituan Select, and related services.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.