如何找出哪些列组合在 adwords 中有效

Posted

技术标签:

【中文标题】如何找出哪些列组合在 adwords 中有效【英文标题】:How do I find out which column combinations are valid in adwords 【发布时间】:2015-02-25 18:10:32 【问题描述】:

我正在使用 adwords api 生成报告。 请多多包涵,因为我不太熟悉。 我正在使用 api 的 v201409 版本。 我使用 getReportFields 获取 KEYWORD_PERFORMANCE_REPORT 的报告列。 然后我尝试使用这些列的子集下载报告。

对于 KEYWORD_PERFORMANCE_REPORT 我收到错误:

无法选择设备和设备的组合 AssistClicks,AssistClicksOverLastClicks,AssistImpressions,AssistImpressionsOverLastClicks,AveragePageviews,AverageTimeOnSite,BounceRate,反弹,ClickAssistedConversionValue,ClickAssistedConversionValueLong,ClickAssistedConversionValueNonMoney,ClickAssistedConversions,ClickAssistedConversionsOverLastClickConversions,ImpressionAssistedConversionValue,ImpressionAssistedConversionValueLong,ImpressionAssistedConversionValueNonMoney,ImpressionAssistedConversions,ImpressionAssistedConversionsOverLastClickConversions,LastClickConversions,LastClicks,新访问者,浏览量,PercentNewVisitors,VisitDuration,参观, 类型:ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORT。

问题是:如何在不经过反复试验的情况下找出一组有效的列组合。是否有任何文档可以帮助我解决问题。

我查看了http://developers.guge.io/adwords/api/docs/appendix/reports 中 KEYWORD_PERFORMANCE_REPORT 的列,并排除了 api 所说的“不兼容”的列。遇到类似的错误。 谢谢

N.B> 如果我使用在线示例中提供的列尝试此代码,它可以正常工作并按预期下载报告。 代码是: ` 字符串 [] 列名 = "ConversionRateManyPerClickSignificance", "转化率意义", "ViewThroughConversions 意义", "账户货币代码", "AccountDescriptiveName", "AccountTimeZoneId", "广告组 ID", "广告组名", "广告组状态", “辅助印象”, "AssistImpressionsOverLastClicks", "平均每次点击费用", "平均每千次展示费用", "平均浏览量", "平均位置", "AverageTimeOnSite", "BiddingStrategyId", "出价策略名称", "BiddingStrategyType", "活动 ID", "活动名称", "活动状态", "ClickAssistedConversionsOverLastClickConversions", "ClickAssistedConversionValue", “点击”, "点击意义", "点击类型", "ConversionManyPerClickSignificance", “兑换率”, "ConversionRateManyPerClick", “转换”, "转化意义", "ConversionsManyPerClick", "转换类型名称", "转化价值", “成本”, "每转化成本", "CostPerConversionManyPerClick", "CostPerConversionManyPerClickSignificance", "CostPerConversionSignificance", “成本意义”, "CpcBid", "CpcBidSource", "CpmBid", "CpmSignificance", "CriteriaDestinationUrl", “中心”, "CtrSignificance", "客户描述名称", "CvrSignificance", “日期”, "星期几", “设备”, "外部客户 ID", "FinalAppUrls", "FinalMobileUrls", "FinalUrls", "FirstPageCpc", “ID”, “印象辅助转化”, "ImpressionAssistedConversionsOverLastClickConversions", "ImpressionAssistedConversionValue", “印象”, “印象意义”, "是负", "关键字匹配类型", “标签标识”, “标签”, “月”, “年月”, "放置网址", “位置意义”, "主要公司名称", “质量分数”, “四分之一”, "SearchExactMatchImpressionShare", "搜索印象分享", "SearchRankLostImpressionShare", “投币口”, "TrackingUrl模板", "UrlCustomParameters", "ValuePerConversion", "ValuePerConversionManyPerClick", "ViewThroughConversions", “星期”, “年”

    ;
 public static void downloadConsolidatedReportFile(String[] columnNames, final ReportDefinitionDateRangeType forDateRange, final ReportDefinitionReportType reportDefinitionReportType, final String to) throws Exception 
    com.google.api.ads.adwords.lib.jaxb.v201409.Selector selector = new com.google.api.ads.adwords.lib.jaxb.v201409.Selector();
    selector.getFields().addAll(Lists.newArrayList(columnNames));
    ReportDefinition reportDefinition = new ReportDefinition();
    reportDefinition.setReportName("Report " + reportDefinitionReportType.value() + " for dateRange " + forDateRange.value());
    reportDefinition.setDateRangeType(forDateRange);
    reportDefinition.setReportType(reportDefinitionReportType);
    reportDefinition.setDownloadFormat(DownloadFormat.CSV);

    ReportingConfiguration reportingConfiguration = new ReportingConfiguration.Builder()
            .skipReportHeader(true)
            .skipReportSummary(true)
            .build();
    session.setReportingConfiguration(reportingConfiguration);

    reportDefinition.setSelector(selector);

    BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(to)));
    String mccId = session.getClientCustomerId(); //The id from ads.properties file
    Collection<Client> clientIds = getClientAccountIds(mccId);
    try 
        for (Client cl : clientIds) 
            BufferedReader reader = null;
            String customerId = cl.id;
            String name = cl.name;

            session.setClientCustomerId(cl.id);
            try 
                ReportDownloadResponse response =
                        new ReportDownloader(session).downloadReport(reportDefinition);
                if (response == null || response.getHttpStatus() != 200) 
                    handleError(response);
                
                BufferedInputStream bs = new BufferedInputStream(response.getInputStream());
                reader = new BufferedReader(new InputStreamReader(bs));
                String line = null;
                log.info("getting " + reportDefinition.getReportType().value() + " for " + customerId+" "+name);
                reader.readLine(); //Skip the first line of column names
                while ((line = reader.readLine()) != null) 
                    bw.write(line + "\n");
                
             catch (DetailedReportDownloadResponseException e) 
                log.error("An error was thrown downloading report for Customer id: " + customerId+" "+name, e);
                //We have to do this as we have to filter out the mcc id. An exception is thrown by MCC id
                if (e.getType().equals("ReportDefinitionError." + ReportDefinitionErrorReason.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH.getValue())) 
                    continue;
                 else 
                    throw e;
                

             catch (Exception e) 
                log.error("An error was thrown downloading report for Customer id: " + customerId+" "+name, e);
                throw e;
             finally 
                if (reader != null) 
                    reader.close();
                
            

        
     finally 
        if (bw != null) 
            bw.flush();
            bw.close();
        
    

`

没有使用您在下面评论中提到的列。

【问题讨论】:

【参考方案1】:

查看以下文档。 https://developers.google.com/adwords/api/docs/appendix/reports/keywords-performance-report#activeviewcpm

对于某些字段,提供了“与以下字段不兼容”选项。单击该选项以检查不兼容的组合

【讨论】:

【参考方案2】:

在 v201409 的 Keywords Performance Report 中,以下列不可选择:

AssistClicksOverLastClicks
Bounces
ClickAssistedConversionValueLong
ClickAssistedConversionValueNonMoney
ImpressionAssistedConversionValueLong
ImpressionAssistedConversionValueNonMoney
LastClickConversions
LastClicks
NewVisitors
Pageviews
VisitDuration
Visits

建议您尝试删除它们并重试。如果失败,请发布一些代码,以便我们了解您是如何拨打电话的。

AdWords Ad Hoc Reporting 文档为列出允许的指标、属性和细分的每种报告类型提供了downloadable CSV file,以供将来参考。

【讨论】:

我用示例代码更新了问题。上面列出的列未使用。 线程“主”HTTP 响应代码中的异常:400,FieldPath:ConversionRateManyPerClickSignificance,触发器:无法选择 ConversionRateManyPerClickSignificance 和 AssistClicks、AssistClicksOverLastClicks、AssistImpressions 的组合 ...类型:ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORT ——【参考方案3】:

我和你有同样的问题。据我了解,目前还没有 API 可以识别哪些列组合在 adwords 中有效。 所以我在下载文件之前通过请求真正的AWQL来检查组合是否有效。

如果虚拟AWQL返回Adwords: Reporting Error: HTTP code: 400, error type: 'ReportDefinitionError.INVALID_FIELD_NAME_FOR_REPORT', trigger: 'Cannot select a combination of ActiveViewCpm and ConversionCategoryName,ConversionTrackerId,ConversionTypeName', field path: 'ActiveViewCpm'之类的错误,那么我通过反复试验使用错误详细信息来修改列组合。

我不知道这是否是最好的方法......

【讨论】:

以上是关于如何找出哪些列组合在 adwords 中有效的主要内容,如果未能解决你的问题,请参考以下文章

javascript [零展示的adw-alert] #adwords_scripts

javascript [adw-account每月预算暂停] #adwords_scripts

javascript [adw-account performance report] #adwords_scripts

javascript [adw-提高廉价转换关键字的出价] #adwords_scripts

javascript [adw-Pause关键字未执行] #adwords_scripts

javascript [adw-search query performance report] #adwords_scripts