tracking-lib-ott 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,28 +4,20 @@ Thư viện tracking events dành cho các dự án OTT (Web, Smart TV).
|
|
|
4
4
|
|
|
5
5
|
## Cài đặt
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
````bash
|
|
8
8
|
npm install tracking-lib-ott
|
|
9
9
|
# hoặc
|
|
10
10
|
yarn add tracking-lib-ott
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
---
|
|
14
11
|
|
|
15
|
-
## API Endpoint
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
| ------------ | --------------------------------- |
|
|
19
|
-
| Method | `POST` |
|
|
20
|
-
| URL | `/v2/event_batch` |
|
|
21
|
-
| Content-Type | `application/json` |
|
|
22
|
-
| Giới hạn | Tối đa **200 events** mỗi request |
|
|
13
|
+
## Session ID
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
```javascript
|
|
16
|
+
const sessionId = getOrCreateSessionId({
|
|
17
|
+
domain: window.location.hostname,
|
|
18
|
+
expirationMinutes: 30
|
|
19
|
+
})
|
|
27
20
|
|
|
28
|
-
## Sử dụng cơ bản
|
|
29
21
|
|
|
30
22
|
### 1. Khởi tạo (Init)
|
|
31
23
|
|
|
@@ -38,9 +30,8 @@ tracking.init({
|
|
|
38
30
|
|
|
39
31
|
// Required fields
|
|
40
32
|
appId: "ONPlus", // ONPlus, ONLiveTV
|
|
41
|
-
packageId: "
|
|
42
|
-
|
|
43
|
-
sessionSign: "md5_signature", // MD5(append(session_id, secret_key))
|
|
33
|
+
packageId: "Name of app",
|
|
34
|
+
sessionSign: "md5_signature", // MD5(append(sessionId, secret_key))
|
|
44
35
|
deviceId: "device-unique-id",
|
|
45
36
|
platform: "SmartTV", // WebPC | WebMobile | SmartTV | AndroidTV
|
|
46
37
|
deviceModel: "Samsung TV 2024",
|
|
@@ -53,7 +44,7 @@ tracking.init({
|
|
|
53
44
|
deviceOsVersion: "17.0",
|
|
54
45
|
sdkVersion: "1.0.0",
|
|
55
46
|
});
|
|
56
|
-
|
|
47
|
+
````
|
|
57
48
|
|
|
58
49
|
### 2. Set User Info
|
|
59
50
|
|