Skip to content

v1.9.0

Choose a tag to compare

@ccvar ccvar released this 19 Oct 15:05
· 26 commits to main since this release

在后台直接管理 GA4:新建站点统计、拿统计代码、设置关键事件、新建 / 删除事件;还可以生成临时令牌,让 AI 通过接口帮你做这些事。

新功能

  • 新建站点统计:站点列表右上角的“+”。选 Google 账号和 GA4 账号,填网址,就会在 GA4 里新建媒体资源和网站数据流,并给出统计代码;站点自动出现在列表里。没有 GA4 账号时也可以在这里新建(同意 Google 的条款后回来刷新)。这个域名已经有媒体资源时会先提醒
  • 事件管理:站点详情顶部新增“事件”下拉,里面有“事件列表”和“统计代码”两个弹窗
    • 事件列表显示近 28 天收到的事件和次数,并标出类型:自动(GA4 自动收集、增强型衡量)、推荐(Google 推荐的事件名)、自定义;可以按类型筛选
    • 可以一键把事件设为关键事件或取消
    • 可以用规则新建事件(例如访问某个网址、点击某个链接时记为 sign_up),也可以删除规则
    • 统计代码弹窗显示衡量 ID、gtag 代码和发送自定义事件的示例,可一键复制
    • 优化建议“没有转化”可以直接打开事件列表
  • AI 接口:站点列表的“AI 接口”按钮,生成有有效期的临时令牌,把生成的那段话发给 Claude、ChatGPT 等 AI,它就能读取站点数据、新建站点统计、设置关键事件、新建或删除事件
    • 每个令牌可以分别勾选权限,随时吊销;令牌只保存哈希值
    • AI 的每一步操作都有记录;删除类操作要你在后台确认后才执行,按钮上显示待确认的数量
    • 每个令牌每小时最多 300 次请求;接口说明见 GET /api/ai

改进

  • 后台不再使用浏览器原生下拉框,统一换成新的下拉菜单
  • 弹窗的关闭按钮放到标题栏右上角;事件列表只有表格滚动,标题、筛选和表头固定不动

升级提示

  • 新建媒体资源、管理事件需要 GA4 编辑权限:升级后打开事件列表或新建站点统计时,按提示点“重新授权”一次(自己部署的需要已在 Google Cloud 项目里启用 Google Analytics Admin API)
  • 数据库会在升级后自动补上新表,不用手动操作

Manage GA4 from the admin: create site tracking, get the tracking code, set key events, and create or delete events. You can also generate a temporary token so an AI can do all this through an API.

New

  • Create site tracking: the "+" at the top right of the Sites list. Pick a Google account and GA4 account and enter the site URL; a GA4 property and web data stream are created, and you get the tracking code. The site shows up in the list on its own. If you don't have a GA4 account yet, you can create one here too (accept Google's terms, then come back and refresh). You're warned first if the domain already has a property
  • Event management: a new "Events" dropdown at the top of the site page with two dialogs, "Event list" and "Tracking code"
    • The event list shows the events received in the last 28 days with counts, tagged by type: Auto (collected by GA4, including enhanced measurement), Recommended (event names recommended by Google) and Custom; filter by type
    • Turn any event into a key event, or back, with one switch
    • Create events with rules (for example, record sign_up when a URL is visited or a link is clicked) and delete rules
    • The tracking code dialog shows the measurement ID, the gtag snippet and an example of sending a custom event, each with a copy button
    • The "No conversions" suggestion opens the event list directly
  • AI API: the "AI API" button on the Sites list generates a temporary token with an expiry. Send the generated message to Claude, ChatGPT or another AI, and it can read site data, create site tracking, set key events, and create or delete events
    • Each token has its own permissions and can be revoked at any time; only a hash of the token is stored
    • Every AI action is logged; deletions run only after you confirm them in the admin, and the button shows how many are waiting
    • Up to 300 requests per token per hour; the API guide is at GET /api/ai

Improved

  • The admin no longer uses the browser's native dropdowns; they're replaced with a new dropdown menu
  • Dialog close buttons moved to the top right of the title bar; in the event list only the table scrolls, while the title, filters and table header stay in place

Upgrade notes

  • Creating properties and managing events needs GA4 edit access: after upgrading, click "Re-authorize" once when the event list or the create-tracking dialog asks for it (self-hosted setups need the Google Analytics Admin API enabled in their Google Cloud project)
  • The database adds the new tables automatically after the upgrade; nothing to do by hand

升级方法 / How to upgrade: https://github.com/ccvar/cligc_link#升级