gpt4 book ai didi

google-analytics - Google Analytics 查询资源管理器与 api 结果不匹配

转载 作者:行者123 更新时间:2023-12-02 20:51:48 25 4
gpt4 key购买 nike

我有以下请求:

     viewId: XXXXXX,
dateRanges: [ { startDate: '7daysAgo', endDate: 'today' } ],
metrics: [{expression: 'ga:sessions'}, {expression: 'ga:avgSessionDuration'}],
dimensions: [{name: 'ga:date'}, {name: 'ga:country'}, {name: 'ga:source'}, {name: 'ga:countryIsoCode'}, {name: 'ga:pagePath'}],
samplingLevel: 'LARGE'

当我在 GA Query Explorer 上运行此查询时我得到的数据完全按照我想要的方式返回。

当我发出 API 请求时,我仅返回 session > 0 的行。

我认为查询资源管理器仍在运行 API 的 V3。但我是否遗漏了一些明显的东西?

这是来自查询浏览器的响应。红色部分是我通过节点请求执行完全相同的调用时返回的内容:

enter image description here

最佳答案

经过更多研究后,我在 Google Analytics API v3 到 v4 中发现了以下内容 migration docs :

The v3 include-empty-rows parameter corresponds to the includeEmptyRows field in v4. The v3 parameter defaults to true, while in v4 the field defaults to false. If you do not have the value set in v3 you will need to set the value to true in v4.

由于查询资源管理器使用的是 v3,这就是您看到差异的原因。

关于google-analytics - Google Analytics 查询资源管理器与 api 结果不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43392322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com