Skip to content

Data Masking

If you wish to perform full-field masking, it is recommended to use dataModifier for better performance. If you need fine-grained replacement for specific data types, it is recommended to use lineDataModifier.

Do not execute complex or high-latency logic within callback methods, as this will significantly impact the SDK's data writing performance.

Single Field Modification (dataModifier)

  • Purpose: Modifies a single field value within the data.
  • Parameter Format: { key: newValue }
  • Example: { 'device_uuid': 'xxx' } will replace the value of the device_uuid field in the target data with xxx.

Single Data Line Modification (lineDataModifier)

  • Purpose: Modifies specified field values within a certain type of data.
  • Parameter Format: { measurement: { key: newValue } }
  • Example: { 'view': { 'view_url': 'xxx' } } will replace the view_url field value for all data of type view with xxx.

Supported data types for measurement:

  • RUM data: view, resource, action, long_task, error
  • Log data: log

Configuration Example

var ftModule = uni.requireNativePlugin("GCUniPlugin-MobileAgent");

ftModule.sdkConfig({
    datakitUrl: 'your datakitUrl',
    debug: true,
    dataModifier: {
        device_uuid: 'xxx'
    },
    lineDataModifier: {
        resource: {
            response_header: 'xxx'
        },
        view: {
            view_url: 'xxx'
        }
    }
});