【发布时间】:2021-07-04 19:53:53
【问题描述】:
尝试使用 GAMP for nodejs 收集统计信息。当我测试调试问题时,我经常得到:参数'v'需要一个值。为什么这不起作用?
async function gaCollect(){
var url = 'https://www.google-analytics.com/debug/collect'
var body = {v: "1", tid: "UA*******", cid: "***", t: "event", ec: "ws", ea: "get", el: "test", ev: "1"}
var res = await fetch(url,{method:'POST',body:JSON.stringify(body),headers: {'Content-Type': 'application/json'}});
var data = await res.json();
console.log(data.hitParsingResult[0])
}
【问题讨论】:
标签: node.js google-analytics node-fetch