【问题标题】:Why is Google Analytics API for Unsampled Reports not showing Google Drive Download Link?为什么 Google Analytics API for Unsampled Reports 不显示 Google Drive 下载链接?
【发布时间】:2020-04-06 09:29:01
【问题描述】:

CSV 已下载到 Google 云端硬盘,但当我查询非抽样报告 ID 时 get unsampled report响应中没有出现下载类型...

这是应该出现的resource。但我得到的部分回应是:

{
  "id": string,
  "kind": "analytics#unsampledReport",
  "selfLink": string,
  "title": string,
  "accountId": string,
  "webPropertyId": string,
  "profileId": string,
  "start-date": string,
  "end-date": string,
  "status": string,
  "created": datetime,
  "updated": datetime 
}

我有一个启用了以下 API 的服务帐户:

  • 谷歌分析 API
  • 谷歌分析报告 API
  • Google 云端硬盘 API

我在 Google Analytics 中拥有我的服务帐户的所有权限。

我正在使用 python 客户端发出请求:

accountId = self._ga_property.account_id
web_property_id = self._ga_property.web_property_id
unsampled_report = self._auth_service.management().unsampledReports().get(
            accountId=accountId,
            webPropertyId=web_property_id,
            profileId=self._profileId,
            unsampledReportId=id
        ).execute()
return unsampled_report

如果您需要任何额外的信息,我很乐意提供。

我已经尝试过Stack Overflow answer,但我的回复中没有下载链接。

问题是没有得到响应,问题是得到部分响应

【问题讨论】:

    标签: python google-analytics google-drive-api google-analytics-api


    【解决方案1】:

    如果状态为 COMPLETE,您可以在回复中找到下载链接。当您查询非抽样报告时,状态为 PENDING。尝试在几分钟后调用报告 ID,当状态为 COMPLETE 时,API 应返回 driveDownloadDetails.documentId。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-30
      相关资源
      最近更新 更多