Use this file to discover all available pages before exploring further.
After initialization, the WeChat Mini Program RUM SDK automatically collects user experience data through Mini Program runtime APIs. You can disable specific collection types through initialization parameters and use manual APIs to add business events.
Before sending each RUM event, the SDK enriches it with application, session, page, connectivity, user, and context information. These fields let the Explorer correlate events from the same user session, page view, and network state.
Field
Description
application.id
RUM application ID from the applicationId initialization parameter
session.id
Session ID generated by the SDK
session.type
Always user
session.has_replay
Always false
session.sampled_for_replay
Always false
source
Always miniprogram
view.id
Page view ID associated with the current event
view.name / view.url
Page name associated with the current event, defaulting to the Mini Program page route
connectivity.status
Network connection status, either connected or not_connected
connectivity.interfaces
Network interface, such as wifi, cellular, none, or unknown
connectivity.effective_type
Cellular network type, such as 2g, 3g, or 4g
usr
User information set through setUser(), or anonymous user information generated by the SDK
context
Global context set through setGlobalContext()
The SDK reads the initial network type through wx.getNetworkType and updates network state for later events through wx.onNetworkStatusChange.
When trackPages is enabled, the SDK wraps the global Page constructor and listens to page lifecycle hooks. Each page creates view events, and the default page name comes from the page instance route.The SDK records the following page information:
Field
Description
view.id
Unique page ID generated by the SDK
view.name / view.url
Page route name, or unknown when unavailable
view.referrer
Previous page name
view.loading_type
Page loading type, either initial_load or route_change
view.loading_time
Time from onLoad to onReady
view.time_spent
Accumulated time while the page is active in the foreground
view.onload_to_onshow
Time from onLoad to the first onShow
view.onshow_to_onready
Time from the first onShow to onReady
view.action.count
Number of actions associated with the current view
view.error.count
Number of errors associated with the current view
view.resource.count
Number of resource requests associated with the current view
The SDK updates the active page duration every 3 seconds. When a page moves to the background, is hidden, or unloads, the SDK sends a view update with the hidden or terminated state.
When trackActions is enabled, the SDK wraps functions in the page configuration. If a function receives a first argument that contains a string type field, the SDK records a user action.Action events include the following information:
Field
Description
action.type
Mini Program event type, such as tap
action.target.name
Read from event.currentTarget.dataset.name, dataset.content, or dataset.type; falls back to unknown
_dd.action.position
Records x and y when the event contains coordinates
action.loading_time
Time until page activity becomes idle after the action
action.error.count
Number of errors produced during the action
action.resource.count
Number of resource requests produced during the action
Set data-name on clickable components to make action names easier to identify, for example <button data-name="submit_order">Submit order</button>.
When trackRequests is enabled, the SDK wraps wx.request, wx.uploadFile, and wx.downloadFile. SDK intake requests and calls marked as internal requests are skipped to avoid recursive collection.Network requests create resource events:
Field
Description
resource.type
xhr, upload, or download
resource.url
Request URL
resource.method
Request method. wx.request defaults to GET, uploads are always POST, and downloads are always GET
resource.status_code
HTTP status code when the request succeeds
resource.duration
Request duration
resource.error_message
Error message when the request fails
resource.trace_id / resource.span_id
Trace identifiers generated when distributed tracing is enabled and sampled
When trackErrors is enabled, the SDK subscribes to Mini Program app errors and unhandled Promise rejections.
Source
SDK source
Description
wx.onError
app
Mini Program runtime errors
wx.onUnhandledRejection
promise
Unhandled Promise rejections
addError()
custom
Business errors that you report manually
Error events include the error message, optional stack, and source. When manually reporting an error, pass error.stack as the third argument to addError().
When trackPerformance is enabled, the SDK reads Mini Program performance APIs. If the runtime supports the corresponding APIs, the SDK writes metrics to view events.
Metric
Description
view.app_launch
Mini Program startup duration from the navigation entry named appLaunch
view.evaluate_script
Main package script execution duration from the script entry named evaluateScript
view.first_render
First render duration from the render entry named firstRender
view.first_render_detail
First render breakdown, including view layer ready, initial data send, initial data receive, render start, and render end
view.performance.fcp.timestamp
First Contentful Paint timestamp
view.performance.lcp.timestamp
Largest Contentful Paint timestamp
view.setdata.count
Number of setData updates in the current view
view.setdata.duration
Accumulated setData update duration in the current view
If the current Mini Program base library does not support wx.getPerformance or setUpdatePerformanceListener, the SDK skips the corresponding metrics without affecting other data collection.
Calling addCustomEvent(name, context?) creates a custom event. Use it to record business events that cannot be inferred automatically from page lifecycle hooks, actions, or requests.
Disabling an automatic collection type only affects its automatic listener. Manual APIs remain available. For example, after disabling trackActions, you can still call addAction() to report a custom action.
The SDK adds collected RUM events to batches before sending them:
Configuration
Value
Default flush interval
15000 milliseconds, configurable through flushInterval
Maximum messages per batch
50
Maximum batch size
64 KB
Maximum message size
256 KB
Background flush
The SDK flushes the batch when the Mini Program triggers onAppHide
Unsent payloads are persisted through Mini Program storage and resent the next time the batch reporting module starts. The SDK keeps up to 10 pending payloads with a total size up to 64 KB, and discards payloads older than 24 hours.