RiESA
V2EX  ›  问与答

想把谷歌统计的数据嵌入在网站页面内显示,有什么现成的工具或者轮子吗?

  •  
  •   RiESA · Apr 4, 2020 · 1085 views
    This topic created in 2251 days ago, the information mentioned may be changed or developed.

    比如展示 PV 之类的,找了几个都是收费,而且价格比较高的

    2 replies    2020-04-05 02:31:17 +08:00
    Yourshell
        1
    Yourshell  
       Apr 4, 2020   ❤️ 1
    ysc3839
        2
    ysc3839  
       Apr 5, 2020 via Android
    https://github.com/ysc3839/ga-pageview
    我自己用 Node.js 写了一个,通过 analyticsreporting 获取数据,返回的数据格式和 https://busuanzi.ibruce.info 是相同的,部署在 Google Firebase Functions 上面。
    因为只是自己使用的项目,所以并没有写文档。
    存在一些问题,统计数据不是实时的,印象中是访问后约 20 分钟才会增加。其次 Google Analytics 是不会合并带有 query string 的 URL 的,直接通过 URL 匹配的话会导致取出来的数据偏少,我的做法是使用 begin with 来匹配。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5536 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 08:40 · PVG 16:40 · LAX 01:40 · JFK 04:40
    ♥ Do have faith in what you're doing.