UserID settings
Set userID through localStorage interface
Set the key TY_USER_ID
in Before probe code execution local Storage and the probe will upload using the set ID as the user ID.
localStorage.setItem('TY_USER_ID', 'user1');
Code example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
//Set user ID
localStorage.setItem('TY_USER_ID', 'user1');
</script>
<!--Introducing probes-->
<script src="./tingyun_rum.js"></script>
</head>
<body>
</body>
</html>
Set user ID via probe interface
Example:
window.TINGYUN && window.TINGYUN.setUid('username1');
This is done as needed to ensure that the probe is loaded.
Custom Settings Device ID
Set device ID through localStorage interface
Set Before probe code execution the key TY_DEVICE_N_ID
in localStorage and the probe will upload using the set ID as the device ID.
localStorage.setItem('TY_DEVICE_N_ID', 'device1');
Code example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script>
//Set device ID
localStorage.setItem('TY_DEVICE_N_ID', 'device1');
</script>
<!--Introducing probes-->
<script src="./tingyun_rum.js"></script>
</head>
<body>
</body>
</html>
Set device ID via probe interface
Example:
window.TINGYUN && window.TINGYUN.setDid('device1');
This is done as needed to ensure that the probe is loaded.