All Products
Search
Document Center

Mobile Platform as a Service:Configure upload switch

Last Updated:Feb 03, 2026

You can use switch configurations to dynamically control log reporting. The server sends switch values to modify the conditions for automatic log reporting.

Mobile Analysis Service (MAS) relies on the client SDK for tagging. The SDK collects data on user behavior and app performance. It generates logs from this data and reports them to the server. Real-time or offline computing then processes these logs into metrics and dashboards.

mPaaS charges for traffic from reported tagging logs. To avoid unnecessary costs, you can manage log reporting through switch configurations. For more information about traffic charges for log reporting, see Postpaid.

This topic describes how to add and manage tagging configurations.

Add a tagging configuration

  1. Log on to the mPaaS console. In the navigation pane on the left, choose Mobile Analysis Service > Log management > Configure upload switch. In the upper-left corner, click Tagging Configuration to open the log switch list page.

  2. Click New Business and configure the tagging information.

    • Business Code: The business code. For custom behavior tags, the business code configuration varies by platform.

      • Android: The bizType set by the client using the MPLogger.event(String logId, String bizType, Map<String, String> params) method. The bizType cannot contain underscores (_).

      • iOS: The default value is behavior. The client can customize it using the bizType parameter in the writeLogWithActionId interface. For more information, see Android business codes or iOS business codes.

    • Business Name: A description of the tagging operation. You can customize the business name.

    • Log Header: Field 01 in the log model. It is used to distinguish different log types. The log header for custom behavior tags is D-VM. For more information, see Log model.

  3. Click Add to add the tagging configuration. For more information about modifying the configuration, see Modify a tagging configuration below.

Modify a tagging configuration

The new tagging configuration is displayed in the log switch list. You can set the log reporting switch, configure network settings, modify tags, and delete the configuration.

Set the log reporting switch

You can turn log reporting on or off. When the reporting switch is on, tagging logs for the operation are automatically reported.

Set the reporting network

You can choose to report tagging logs in All network environments (such as 2G, 3G, 4G, and Wi-Fi) or only in a Wi-Fi environment.

Modify tagging information

In the Actions column, click Modify to open the tagging configuration modification page. You can make further changes to the configuration:

  • Business Code: Corresponds to the business code you entered when you added the tagging configuration.

  • Description: Corresponds to the business name you entered when you added the tagging configuration.

  • Log Header: Corresponds to the log header you entered when you added the tagging configuration.

  • Minimum upload level: Each log has an importance level of 1, 2, or 3. Level 1 is the most important, followed by level 2, and then level 3. If you set the minimum reporting level to 2, logs with levels 1 and 2 are reported, but level 3 logs are not. The default level for custom behavior tags is 2. For iOS applications, you can modify the log level during client-side tagging. For more information, see iOS custom behavior tagging.

  • Uploaded logs: Client-side tagging logs are first written to a local file. When the number of logs for this business code type in the local file reaches a specified count, they are automatically reported to the Mobile Analysis Service server-side. For more information, see Android automatic log reporting or iOS automatic log reporting.

  • Log upload rate: The rate of log reporting, calculated per user. This is a per-mille value. For example, a value of 1000 means logs are reported for all users.

  • Strategy: If you check the Upload in background policy, the reporting time varies by platform.

    • Android: Automatic log reporting is triggered when the application enters the background for more than half an hour.

    • iOS: Automatic log reporting is triggered immediately when the application enters the background. For more information, see Android log reporting or iOS log reporting.

Initialize the business

Logs written locally by the client are automatically reported to the Mobile Analysis Service server-side when specified conditions are met. The default tagging configuration determines the trigger conditions for automatic reporting. After you create a new application, you can use the Initialize Business feature to sync the default tagging configurations to the new application's tagging configuration list.

To initialize the business configuration, click the Initialize Business button on the page and confirm the action. After a successful initialization, the default tagging configuration list is displayed.

Important

Even if you do not use the Initialize Business feature to sync the default tagging configurations to the new application's list, the default configurations still take effect. However, they will not be displayed in the tagging configuration list.

Mock

As described earlier, you can add and modify tagging configurations on the console page to control the log reporting policy. The console also lets you configure tagging directly using JSON. However, we do not recommend using this feature for the following reasons:

  • The mock feature is only a convenient way to configure tagging. It does not provide additional features.

  • If you configure the same business tag using both the console page and the mock feature, the mock configuration takes precedence.

  • If you are not familiar with the tagging configuration format, you may find it difficult to use the mock feature correctly. Incorrect use could affect the default automatic log reporting behavior.

Add a mock configuration

Follow these steps to add a mock configuration:

  1. On the Configure Upload Switch page, click Add Mock Configuration.

  2. Fill in the configuration information.

    • Version: Select your application version.

    • Platform: Select the application type.

    • Value: The configuration information in JSON format. For more information, see the Mock configuration format section below.

  3. After you confirm that the information is correct, click OK to add the mock configuration.

Mock configuration format

The mock configuration format is as follows:

{
                        "LogHeader1": {
                        "BusinessCode1": {
                        "write": "yes",
                        "send": [
                        "wifi"
                        ],
                        "maxLogCount": 50,
                        "level": 3,
                        "uploadRate": 1000,
                        "event": [
                        "gotoBackground"
                        ]
                        },
                        "BusinessCode2": {
                        ...
                        },
                        ...
                        },
                        "LogHeader2": {
                        ...
                        },
                        ...
                        }
  • LogHeader: Corresponds to the log header in the tagging configuration.

  • BusinessCode: Corresponds to the business code in the tagging configuration.

  • write: Corresponds to the reporting switch in the tagging configuration. The value is "yes" when the switch is on, and "no" otherwise.

  • send: Corresponds to the network in the tagging configuration. The value is ["2g", "3g", "4g", "wifi"] for All networks and ["wifi"] for Wi-Fi only.

  • maxLogCount: Corresponds to the log reporting count in the tagging configuration.

  • level: Corresponds to the minimum reporting level in the tagging configuration.

  • uploadRate: Corresponds to the log reporting rate in the tagging configuration.

  • event: Corresponds to the policy in the tagging configuration. The value is ["gotoBackground"] if the Report in Background policy is selected, and [] otherwise.