tracking-lib-ott 1.0.4 → 1.0.5
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 +21 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,8 +22,8 @@ tracking.init({
|
|
|
22
22
|
debug: true, // Bật log để debug
|
|
23
23
|
|
|
24
24
|
// Thông tin bắt buộc
|
|
25
|
-
session_id: "unique-session-id",
|
|
26
|
-
session_sign: "session-signature",
|
|
25
|
+
session_id: "unique-session-id", // Định danh session id khi người dùng bắt đầu vào ứng dụng.session_id sẽ được include trong mọi event.lient tự sinh ra sử dụng thư viện uuid_v4()
|
|
26
|
+
session_sign: "session-signature", // Mỗi SDK client init bằng một key sign cho message. Sử dụng phương thức sign như sau:MD5(append(session_id,secret_key)) secret_key: Server cùng cấp để init SDK
|
|
27
27
|
user_id: 12345,
|
|
28
28
|
deviceId: "device-unique-id",
|
|
29
29
|
deviceModel: "iPhone 14",
|
|
@@ -31,14 +31,15 @@ tracking.init({
|
|
|
31
31
|
ip_address: "192.168.1.1",
|
|
32
32
|
|
|
33
33
|
// Thông tin tuỳ chọn
|
|
34
|
-
appName: "
|
|
34
|
+
appName: "app_name",
|
|
35
35
|
appId: "app-id",
|
|
36
|
-
packageId: "
|
|
36
|
+
packageId: "Là package hoặc bundle id nếu website là domain website",
|
|
37
37
|
platform: "Web", // 'Web' | 'Ios' | 'Android'
|
|
38
38
|
os_version: "17.0",
|
|
39
39
|
app_version: "1.0.0",
|
|
40
40
|
language: "vi",
|
|
41
41
|
country: "VN",
|
|
42
|
+
net_type: "Loại mạng mà khác hàng đang kết nối",
|
|
42
43
|
});
|
|
43
44
|
```
|
|
44
45
|
|
|
@@ -289,20 +290,20 @@ tracking.init({
|
|
|
289
290
|
|
|
290
291
|
Khởi tạo thư viện với config.
|
|
291
292
|
|
|
292
|
-
| Option | Type | Required | Mô tả
|
|
293
|
-
| -------------- | ------- | -------- |
|
|
294
|
-
| `baseURL` | string | ✅ | URL endpoint để gửi events
|
|
295
|
-
| `session_id` | string | ✅ | Session ID của user
|
|
296
|
-
| `session_sign` | string | ✅ | Session signature
|
|
297
|
-
| `user_id` | number | ✅ | User ID (-1 nếu chưa login)
|
|
298
|
-
| `deviceId` | string | ✅ | Device unique ID
|
|
299
|
-
| `deviceModel` | string | ✅ | Tên model thiết bị
|
|
300
|
-
| `deviceBrand` | string | ✅ | Hãng thiết bị
|
|
301
|
-
| `ip_address` | string | ✅ | IP address
|
|
302
|
-
| `debug` | boolean | ❌ | Bật/tắt debug logs
|
|
303
|
-
| `appName` | string | ❌ | Tên app (default: `
|
|
304
|
-
| `platform` | string | ❌ | Platform (default: `Web`)
|
|
305
|
-
| `pageMap` | object | ❌ | Custom page mapping
|
|
293
|
+
| Option | Type | Required | Mô tả |
|
|
294
|
+
| -------------- | ------- | -------- | ----------------------------- |
|
|
295
|
+
| `baseURL` | string | ✅ | URL endpoint để gửi events |
|
|
296
|
+
| `session_id` | string | ✅ | Session ID của user |
|
|
297
|
+
| `session_sign` | string | ✅ | Session signature |
|
|
298
|
+
| `user_id` | number | ✅ | User ID (-1 nếu chưa login) |
|
|
299
|
+
| `deviceId` | string | ✅ | Device unique ID |
|
|
300
|
+
| `deviceModel` | string | ✅ | Tên model thiết bị |
|
|
301
|
+
| `deviceBrand` | string | ✅ | Hãng thiết bị |
|
|
302
|
+
| `ip_address` | string | ✅ | IP address |
|
|
303
|
+
| `debug` | boolean | ❌ | Bật/tắt debug logs |
|
|
304
|
+
| `appName` | string | ❌ | Tên app (default: `app_name`) |
|
|
305
|
+
| `platform` | string | ❌ | Platform (default: `Web`) |
|
|
306
|
+
| `pageMap` | object | ❌ | Custom page mapping |
|
|
306
307
|
|
|
307
308
|
### `tracking.trackPageView(url)`
|
|
308
309
|
|
|
@@ -348,9 +349,9 @@ Mỗi event được gửi lên server có cấu trúc:
|
|
|
348
349
|
|
|
349
350
|
```json
|
|
350
351
|
{
|
|
351
|
-
"app_name": "
|
|
352
|
+
"app_name": "app_name",
|
|
352
353
|
"app_id": "",
|
|
353
|
-
"package_id": "
|
|
354
|
+
"package_id": "Là package hoặc bundle id, nếu website là domain website",
|
|
354
355
|
"platform": "Web",
|
|
355
356
|
|
|
356
357
|
"session_id": "...",
|