English | 简体中文
npm install
npm run build
const SDK = require('@datarangers/sdk-javascript');
SDK.init({
app_id: 1234, // Replace it with the "APP_ID"
channel: 'cn', // Replace it with your report channel
log: true, // Whether to print the log
});
SDK.config({
username: 'xxx', // when you want report username with event
});
SDK.start(); // Setup complete and now events can be sent.
// Take reporting the "video clicked" behavior of users for example
SDK.event('play_video', {
title: 'Here is the video title',
});
// Set "user_unique_id" after a user logs in and the user's unique identifier is retrieved.
SDK.config({
user_unique_id: 'zhangsan', // Unique user identifier
});