【问题标题】:Analytics Reporting API has not been used in project before or it is disabledAnalytics Reporting API 之前未在项目中使用过或已禁用
【发布时间】:2020-07-21 22:06:19
【问题描述】:

错误:googleapiclient.errors.HttpError: <HttpError 403 when requesting https://analyticsreporting.googleapis.com/v4/reports:batchGet?alt=json returned "Analytics Reporting API has not been used in project 190831311549 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/analyticsreporting.googleapis.com/overview?project=xxxx then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.". Details: "[{'@type': 'type.googleapis.com/google.rpc.Help', 'links': [{'description': 'Google developers console API activation', 'url': 'https://console.developers.google.com/apis/api/analyticsreporting.googleapis.com/overview?project=xxxx'}]}]">

步骤:

  1. Google Analytics Reporting API 在云控制台启用
  2. 已创建服务凭据并将电子邮件作为读取/分析用户添加到 GA 帐户
  3. 我正在使用“Hello Analytics Reporting API V4”。蟒蛇代码
  4. 使用apiclient.discoveryanalytics = build('analyticsreporting', 'v4', credentials=credentials, cache_discovery=False)
  5. 我也尝试了绕过我在https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet 处的python 代码的解决方法,但是当我尝试执行身份验证弹出窗口时保持空白并且加载程序一直在旋转并且chrome 开发工具显示Failed to load resource: net::ERR_QUIC_PROTOCOL_ERROR.QUIC_PACKET_READ_ERROR

【问题讨论】:

    标签: google-analytics google-analytics-api


    【解决方案1】:

    重定向到https://console.developers.google.com/apis/api/analyticsreporting.googleapis.com 并使用您创建了client_id 和client_secret 的google 帐户登录,确保您在使用客户端ID 和机密的同一个项目中,否则请更改项目。如果您没有访问权限,请让管理员也这样做

    点击启用按钮,如下图所示

    然后尝试做你的工作。它应该可以正常工作

    【讨论】:

      猜你喜欢
      • 2019-02-06
      • 2023-03-13
      • 2017-05-13
      • 2018-10-18
      • 1970-01-01
      • 2023-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多