【问题标题】:Google Adwords API Issues in "ORDER BY" clause and Average CPC calculations“ORDER BY”子句和平均每次点击费用计算中的 Google Adwords API 问题
【发布时间】:2013-10-14 15:54:49
【问题描述】:

我正在使用我的客户 MCC 帐户来提供报告功能。

我正在使用 Google Adwords PHP API 版本 v201309(最新)。

好的,在使用 AWQL (Reporting/DownloadCriteriaReportWithAwql.php) 获取结果集时,我在执行该文件时遇到了一个查询错误。

即:Type = 'QueryError.INVALID_ORDER_BY_CLAUSE', Trigger = '', FieldPath = ''.

虽然我的查询没有错:

$dateRange = sprintf('%d,%d',
date('Ymd', strtotime('1989-01-01')), date('Ymd', strtotime('now')));

'SELECT CampaignId, CampaignName, AverageCpc, Conversions,
Cost, Date FROM CRITERIA_PERFORMANCE_REPORT 
WHERE CampaignName 
IN ["Local  - Search", "Local - Display", "Display New Landing"] 
DURING '.$dateRange.' ORDER BY Date'; 

我面临的另一个问题是平均每次点击费用,客户 MCC 帐户和特定日期的 API 响应输出中的金额不同。 我想澄清一下,我正在使用 AWQL (Reporting/DownloadCriteriaReportWithAwql.php) 创建直接的 .csv 输出文件。

请查看截图。

  • CSV 文件输出

  • 实时 MCC 帐户

感谢您阅读我的问题。

【问题讨论】:

    标签: php api google-api google-ads-api


    【解决方案1】:

    The Google Developers page on Reports in AdWords Scripts 声明

    报告不支持 ORDER BY 或 LIMIT 子句。结果将是 不按特定顺序返回。

    我正在输出到 Google 电子表格。我的解决方案是制作第二张表格,按公式 =sort('Account Last Month'!A2:E32;1;true) 对输出数据进行排序

    【讨论】:

      【解决方案2】:

      尝试将ORDER BY Date 替换为ORDER BY Date ASC

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多