obsidian/笔记文件/2.笔记/开始和结束会话Session 临时记录.md
2025-03-26 00:02:56 +08:00

2.3 KiB
Raw Permalink Blame History

#灵感

上报数据完整格式如下:
{
 "event_name": "open_login",
 "event_timestamp": 1696646035,
 "public_properties": "{\"uid\":100230,\"device_id\":\"000416f0b81aec53\",\"channel_id\":\"2005\",\"app_version\":\"1.0.1\",\"os\":\"android\",\"os_version\":\"android 8.0.0\",\"device_model\":\"vivo s6\",\"country\":\"US\"}",
 "event_properties": {
 "property1": 123,
 "property2": "value2",
 "property3": 102.5656,
 "property4": true,
 "user_properties": {
 "property5": 123,
 "property6": "value2",
 "property7": 102.5656,
 "property8": true
 }
 }
}

其中public_properties(公共属性)格式如下:
{
 "uid": 100230,
 "device_id": "000416f0b81aec53",
 "channel_id": "2005",
 "app_version": "1.0.1",
 "os": "android",
 "os_version": "android 8.0.0",
 "device_model": "vivo s6",
 "country": "us"
}


整体格式如上你那个sign 可以放到 event_name 那里,取一个开始会话的英文名
然后id和time 可以放到 event_properties 里面
然后 event_properties 里面有个特殊的JsonObject   user_properties是用来装用户属性的这个你可以让业务外部传进来

建议那两个属性 这样命名会好点

id => session_id 
time => session_dur

lua端的逻辑调用参考

!Pasted image 20241031092149.png

ID生成逻辑参考

!Pasted image 20241031093336.png

公共数据接口,参考

!Pasted image 20241101095436.png

用户id接口参考

!Pasted image 20241101100923.png

!Pasted image 20241120090831.png

临时uid数据同步

!Pasted image 20241122091643.png

设置临时id

!img_v3_02h0_8586eae2-88fb-446c-b606-ebc3d8a521dh.jpg

默认数据中台 接口

!Pasted image 20241203090922.png

初始发的数据应该有8条如果加上结束的数据采集应该是一次有9条数据

!Pasted image 20241203100748.png

lua端设置uid相关

!Pasted image 20250106142032.png

用户数据的设置参考amp的用户数据设置

!Pasted image 20250107154654.png

!Pasted image 20250107162733.png

调试测试链接:

https://global-receiver-ias.icongamesg.com/report/?appid=3f99e16c541a
https://7b6zvje56lpbtmjuzwulj36qoi0hikbc.lambda-url.us-east-1.on.aws?appid=
8d482dec8f6d

如果要测试临时id这样处理一下就好

!Pasted image 20250115143333.png