本文介绍了AgeGenderAudienceReportRequest返回空结果,但数据存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要提取年龄/性别表现统计数据。我在Bing Ads界面中看到了数据。
这是最终回复:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:TrackingId xmlns:h="https://bingads.microsoft.com/Reporting/v12">3e386c16-d488-4142-9a7a-944013549835</h:TrackingId></s:Header><s:Body><PollGenerateReportResponse xmlns="https://bingads.microsoft.com/Reporting/v12"><ReportRequestStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ReportDownloadUrl i:nil="true"/><Status>Success</Status></ReportRequestStatus></PollGenerateReportResponse></s:Body></s:Envelope>
这是我的代码(ReportAggregation.Daily和TimePeriod列的结果相同):
This is my code (same result for ReportAggregation.Daily and TimePeriod column):
AgeGenderAudienceReportRequest report = new AgeGenderAudienceReportRequest();
report.setFormat(ReportFormat.XML);
report.setReportName("My Report");
report.setReturnOnlyCompleteData(false);
report.setAggregation(ReportAggregation.SUMMARY);
ArrayOflong accountIds = new ArrayOflong();
accountIds.getLongs().add(authorizationData.getAccountId());
report.setScope(new AccountThroughAdGroupReportScope());
report.getScope().setAccountIds(accountIds);
report.setTime(new ReportTime());
report.getTime().setCustomDateRangeStart(new Date());
report.getTime().getCustomDateRangeStart().setDay(1);
report.getTime().getCustomDateRangeStart().setMonth(Calendar.DECEMBER);
report.getTime().getCustomDateRangeStart().setYear(2018);
report.getTime().setCustomDateRangeEnd(new Date());
report.getTime().getCustomDateRangeEnd().setDay(31);
report.getTime().getCustomDateRangeEnd().setMonth(Calendar.DECEMBER);
report.getTime().getCustomDateRangeEnd().setYear(2018);
ArrayOfAgeGenderAudienceReportColumn requestColumns = new ArrayOfAgeGenderAudienceReportColumn();
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.ACCOUNT_NAME);
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.AD_GROUP_NAME);
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.AGE_GROUP);
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.GENDER);
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.IMPRESSIONS);
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.CLICKS);
requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.SPEND);
//requestColumns.getAgeGenderAudienceReportColumns().add(AgeGenderAudienceReportColumn.TIME_PERIOD);
report.setColumns(requestColumns);
reportingDownloadParameters.setReportRequest(report);
File resultFile = reportingServiceManager.downloadFileAsync(
reportingDownloadParameters,
null).get(TimeoutInMilliseconds, TimeUnit.MILLISECONDS);
请告知。
谢谢
推荐答案
谢谢,
Eric
这篇关于AgeGenderAudienceReportRequest返回空结果,但数据存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!