【问题标题】:Generating Historical Metrics in Google Ads在 Google Ads 中生成历史指标
【发布时间】:2023-01-17 15:40:25
【问题描述】:

根据文档To generate historical metrics: Create a KeywordPlan, KeywordPlanCampaigns, KeywordPlanAdGroups, KeywordPlanCampaignKeywords, and KeywordPlanAdGroupKeywords. Call KeywordPlanService.GenerateHistoricalMetrics with that keyword plan.

这些计划以 4 元素、斜杠分隔的字符串形式出现,例如customers/1879809528/keywordPlanCampaigns/413340892。但是,在修改 sample code 以调用 GenerateHistoricalMetrics 之后,我发现此时的 API 需要一个很长的 KeywordPlanId。

这个数字是计划字符串中的第 4 项吗?显然不是,因为跟踪日志中的这个片段表明:

...
Response
--------
Headers: {
  "content-disposition": "attachment",
  "request-id": "ahE6lqAnzToj3H65rHtHbA",
  "date": "Mon, 30 May 2022 06:39:19 GMT",
  "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\""
}

{ "results": [ { "resourceName": "customers/1879809528/keywordPlanCampaigns/413340892" } ] }
...
Response
--------
...

Fault: {
  "StatusCode": 3,
  "Details": "Request contains an invalid argument.",
  "RequestId": "mMZTztmu4ufHpgJ77xph9Q",
  "Failure": {
    "errors": [
      {
        "errorCode": {
          "keywordPlanError": "KEYWORD_PLAN_NOT_FOUND"
        },
        "message": "No plan with planId[413340892] exists"
      }
    ],
    "requestId": "mMZTztmu4ufHpgJ77xph9Q"
  }
}

那么如何从计划到指标呢?

【问题讨论】:

    标签: google-ads-api


    【解决方案1】:

    看起来你传递了错误的 resource_name, 它应该是 keywordPlan 的 resource_name。 示例:“客户/xxx/keywordPlans/590630346”

    【讨论】:

      猜你喜欢
      • 2019-01-18
      • 2023-02-10
      • 2020-07-05
      • 2020-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多