【问题标题】:Unable to get saved queries through PHP无法通过 PHP 获取已保存的查询
【发布时间】:2018-12-21 14:10:50
【问题描述】:

我在使用 ReportService.getSavedQueriesByStatement 检索已保存查询时遇到问题。 报告类型:历史 我需要获取“总 CPM、CPC、CPD 和 vCPM 收入”

$statementBuilder = (new StatementBuilder())->where('id = :id')
        ->orderBy('id ASC')
        ->limit(1)
        ->withBindVariableValue('id', $savedQueryId);

$savedQueryPage = $reportService->getSavedQueriesByStatement(
        $statementBuilder->toStatement()
    );

致命错误:未捕获的 UnexpectedValueException:保存的查询与此 API 版本不兼容。

【问题讨论】:

    标签: php google-dfp google-ad-manager


    【解决方案1】:

    检查您保存的查询中的所有字段是否与 API 兼容。 很可能是您的日期范围有问题,因为 UI 和 API 中的日期范围不同,请尝试选择“昨天”作为日期范围,看看效果是否更好。

    来自常见问题解答: https://developers.google.com/ad-manager/api/reporting

    为什么我保存的查询与 API 不兼容?

    API 中不提供某些报告功能。这包括 列、维度属性、维度和日期范围类型。为了 不兼容的日期范围类型,您可以使用支持的保存查询 键入以使其可检索,然后更改查询以满足您的需要 固定日期范围。

    【讨论】:

      猜你喜欢
      • 2017-11-30
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-23
      • 2020-08-03
      相关资源
      最近更新 更多