为什么未抽样报告的Google Analytics(分析)API没有显示Google云端硬盘下载链接? [英] Why is Google Analytics API for Unsampled Reports not showing Google Drive Download Link?

查看:59
本文介绍了为什么未抽样报告的Google Analytics(分析)API没有显示Google云端硬盘下载链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CSV已下载到Google云端硬盘,但是当我使用以下命令查询未抽样的报告ID时获取未抽样报告没有下载类型出现在响应中...

The CSV is downloaded to Google Drive but when I query the unsampled report ID with get unsampled report no download type appears in the response...

这是资源应该会出现.但是我得到了部分回应,为:

This is the resource that's supposed to appear. But I get a partial response as:

{
  "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的服务帐户:

I have a service account with the following API's enabled:

  • Google Analytics API
  • Google Analytics Reporting API
  • Google Drive API

我拥有我在Google Analytics(分析)中服务帐户的所有权限.

I have all the permissions for my service account in Google Analytics.

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

I'm using python client to make the request:

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

如果您需要任何其他信息,我们很乐意提供.

If you need any extra information I'm happy to provide.

我已经尝试过堆栈溢出答案,但下载链接不在我的答复内.

I've already tried Stack Overflow answer but download link is not inside my response.

问题没有得到回应,问题得到了部分回应

The problem isn't getting a response, the problem is getting a partial response

推荐答案

如果状态为完成",则可以在响应中找到下载链接.查询非抽样报告时,状态为PENDING.尝试在几分钟后调用报告ID,并且状态为COMPLETE时,API应该返回driveDownloadDetails.documentId.

You can find download link in your response if the status is COMPLETE. When you query an unsampled report the status is PENDING. Try to call the report ID after few minutes and when status is COMPLETE the API should return a driveDownloadDetails.documentId.

这篇关于为什么未抽样报告的Google Analytics(分析)API没有显示Google云端硬盘下载链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆