API兼容性:
QRN:v2.3.0
iOS:80011137
Android:60001168
API QAV.logMsg 兼容性:
QRN:v3.12.0
iOS:80011167
Android:60001239
API QAV.componentLog 兼容性:
QRN:v8.0.15
iOS:80011360
Android:60001697
QAV用来做客户端手动埋点。
QAV.log (tag: String, message: String) 此方法已不建议使用,请使用下面的QAV.logMsg客户端手动埋点功能,`tag` 是控件手动唯一标识,`message` 是被操作的控件包含的一组文本。 `tag`值可以为空,`message`不能为空。
QAV.logMsg (message: String)客户端手动埋点功能,``message` 是被操作的控件包含的一组文本。 `message`不能为空。 如果是从上面 `QAV.log` 方法迁移过来的,`tag` 可以拼接到 `message` 里。周知取数据方新的拼接规则即可。
QAV.componentLog (data: Object, options?:{sampleConfig: {type?: 'experience', rate?: number} })客户端手动埋点功能,`data` 是日志数据。`options` 用于日志采样配置。 `data`不能为空, `options` 参数可不传。
import { QAV } from 'qunar-react-native';
//手动埋点
QAV.log('tagString','messageString'); //此方法已不建议使用,后续请使用下面的方法
QAV.logMsg('messageString');
// 示例数据
const data = {
"bizTag": "APP",
"bizType": "app",
"module": "default",
"appcode": "UnUseClass",
"page": "unUseClass",
"id": "track",
"operType": "show",
"key": "app/unUseClass/default/show/track",
"operTime": "*",
}
// 埋点,全部上传。
QAV.componentLog(data);
// 和渲染采样保持一致。渲染采样,则本条日志上传,反之亦然。
QAV.componentLog(data, {sampleConfig: {type: 'experience'}});
// 自行设置采样率。
QAV.componentLog(data, {sampleConfig: {rate: 0.5}});