// Set additional options. $options = array('version' => ADWORDS_VERSION); // Optional: Set skipReportHeader, skipColumnHeader, skipReportSummary to // suppress headers or summary rows. // $options['skipReportHeader'] = true; // $options['skipColumnHeader'] = true; // $options['skipReportSummary'] = true; // Optional: Set includeZeroImpressions to include zero impression rows in // the report output. // $options['includeZeroImpressions'] = true; // Download report. ReportUtils::DownloadReport($reportDefinition, $filePath, $user, $options); printf("Report with name '%s' was downloaded to '%s'.\n", $reportDefinition->reportName, $filePath); } // Don't run the example if the file is being included. if (__FILE__ != realpath($_SERVER['PHP_SELF'])) { return; } try { // Get AdWordsUser from credentials in "../auth.ini" // relative to the AdWordsUser.php file's directory. $user = new AdWordsUser(); // Log every SOAP XML request and response. $user->LogAll(); // Download the report to a file in the same directory as the example. $filePath = dirname(__FILE__) . '/report.csv'; // Run the example. DownloadCriteriaReportExample($user, $filePath); } catch (Exception $e) { printf("An error has occurred: %s\n", $e->getMessage()); }
public function testDownloadCriteriaReportExample() { $filePath = tempnam(sys_get_temp_dir(), 'report'); DownloadCriteriaReportExample($this->user, $filePath); }