【问题标题】:How to align googleads library with Google Ads API v2 deprecation?如何使 googleads 库与 Google Ads API v2 弃用保持一致?
【发布时间】:2020-11-02 13:07:06
【问题描述】:

我每天都有一个从 Google Ads API 提取数据的 Python 脚本。我安装了谷歌广告库的 v20.0.0。 10 月 28 日,它开始失败并出现以下错误:

Error with message " Version v2 is deprecated. Requests to this version will be blocked."

我认为这是因为这条设置线:

ga_service = client.get_service('GoogleAdsService', version='v2')

但是当我将其更改为 v3(只是猜测,因为错误消息没有告诉我接受哪些版本)时,我在运行脚本时得到了这个:

ValueError: Specified Google Ads API version "v3" does not exist. Valid API versions are: "v2", "v1"

我运行了pip install --upgrade googleads,这让我达到了v25.0.0,但仍然出现同样的错误。然后我卸载并重新安装了googleads,但仍然出现相同的错误。

我无法在 Google 的文档中找到迁移指南。有谁知道如何更新包和脚本以使其再次运行?

【问题讨论】:

标签: python-3.x google-api google-ads-api


【解决方案1】:

我的猜测是,您使用的旧 Api 谷歌表示它仍然有效,但从外观上看,他们已将 new api 集成到其中。我假设这是因为他们在 2020 年 10 月 21 日结束了对新 api 的 v2 的支持,这与您的错误相吻合。

我会考虑升级到new api,而不是尝试更新他们使用的 v2 代码,因为 v3 也即将结束,v6 刚刚发布。从 v4 到 v5 我有一些错误,所以升级会更容易。

祝你好运,因为它不仅仅是一个更新,它们与旧版本相比已经发生了相当大的变化。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-21
    • 2019-02-09
    • 2016-01-22
    • 2021-02-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多