converlab-rn-sdk
v4.2.12
Published
react-native event collecting sdk of convertlab
Downloads
6
Readme
converlab-rn-sdk
convertlab DMHub的埋点SDK,适用于react-native 平台。 请参考: https://api-docs.convertlab.com/api-docs/v2/trackevent/track_intro 了解convertlab DMHub 数据埋点。
Installation
npm install converlab-rn-sdk
Usage
import { init, track, push } from 'converlab-rn-sdk';
// ...
useEffect(() => {
// 初始化SDK,并将事件通用字段通过push的方式统一维护
init('1234567890', 'cbe.convertlab.com', () => {
console.log(' init succeed');
// @ts-ignore
// 初始化埋点全局属性
push({ appName: 'com.convertlab.RnDemo', appVersion: '1.0.0'});
});
}, []);
<Button
title="购买"
onPress={() => track('c_purchase', 'Order Page', {amount: 10.88, quantity: 1})}
/>