feat(sdk): 页面浏览/有效停留/事件入口,打包≤15KB
- events.ts:page_view/page_stay(有效停留=可见+30s 内有活动), close 双触发(hidden+pagehide)靠 activeMs 清零不重发 - index.ts:IIFE 入口,队列重放前先替换 g.ctk=dispatch; 首触归因——__ctk_ctx 除设备环境外带 referrer_domain/utm/path - transport.ts:stringify 抛错(track 宿主可控对象)按已换出 批次事件数计 dropped(Task 14 审查加固) - demo 双页互跳;gzip 2209B ≤ 15360B;测试 35→44 Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
<!doctype html><html><head><meta charset="utf-8"><title>CTK Demo 1</title>
|
||||
<script>window.ctk = window.ctk || function(){(ctk.q=ctk.q||[]).push(arguments)};
|
||||
ctk("init", { siteId: "site_x", endpoint: "http://127.0.0.1:8000/api/collect/batch" });</script>
|
||||
<script async src="../dist/v1.js"></script></head>
|
||||
<body><h1>Demo 页 1</h1><a href="page2.html">去第 2 页</a></body></html>
|
||||
Reference in New Issue
Block a user