Hi, I am trying to pull unique Account,Campaign Name, & Campaign ID's using AWQL using PHP. Here's the reporting part of my code:
$reportQuery = 'SELECT AccountDescriptiveName,CampaignName,CampaignId FROM ADGROUP_PERFORMANCE_REPORT';
$reportDownloader = new ReportDownloader($session);
$reportSettingsOverride = (new ReportSettingsBuilder())
->includeZeroImpressions(false)
->skipReportHeader(TRUE)
->skipColumnHeader(FALSE)
->skipReportSummary(TRUE)
->SkipReportHeader(TRUE)
->build();
$reportDownloadResult = $reportDownloader->downloadReportWithAwql($reportQuery, DownloadFormat::CSV, $reportSettingsOverride);
$a = $reportDownloadResult->getAsString();
And this is the output:
[2017-09-06 08:11:06]
AW_REPORT_DOWNLOADER.INFO: clientCustomerId=
509-496-9641 unknown (AwApi-PHP, googleads-php-lib/29.0.0, PHP/7.1.2, GuzzleHttp/6.2.1, curl/7.51.0) "POST /api/adwords/reportdownload/v201708 HTTP/1.1" Status: 200
Account,Campaign,Campaign ID
Account #1,Campaign #2,921452568
Account #1,Campaign #2,921452568
Account #1,Campaign #1,912412908
Account #1,Campaign #1,912412908
As you can see the result is duplicated. How do I only get back distinct rows?
Thank you very much for the help.
Regards
Tim