Where can I set the path? On Friday, January 12, 2018 at 4:24:33 AM UTC+8, Ken Dan Tinio wrote: > > Download a criteria performance report with AWQL > Reference: > https://developers.google.com/adwords/api/docs/samples/php/reporting#download-a-criteria-performance-report-with-awql > > This is my code: > > * public static function runExample(AdWordsSession $session, > $reportFormat) * > * {* > * // Create report query to get the data for last 7 days.* > * $reportQuery = 'SELECT CampaignId, AdGroupId, Id, Criteria, > CriteriaType, '* > * . 'Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT > '* > * . 'WHERE Status IN [ENABLED, PAUSED] DURING LAST_7_DAYS';* > > * // Download report as a string.* > * $reportDownloader = new ReportDownloader($session);* > * // Optional: If you need to adjust report settings just for this > one* > * // request, you can create and supply the settings override here. > Otherwise,* > * // default values from the configuration file (adsapi_php.ini) > are used.* > * $reportSettingsOverride = (new ReportSettingsBuilder())* > * ->includeZeroImpressions(false)* > * ->build();* > * $reportDownloadResult = > $reportDownloader->downloadReportWithAwql($reportQuery, $reportFormat, > $reportSettingsOverride);* > > * self::$report = $reportDownloadResult->getAsString();* > * self::$status = "success";* > * self::$message = "";* > * }* > > * public static function main() * > * {* > * // Generate a refreshable OAuth2 credential for authentication.* > * $oAuth2Credential = (new OAuth2TokenBuilder())* > * ->fromFile()* > * ->build();* > > * // See: AdWordsSessionBuilder for setting a client customer ID > that is* > * // different from that specified in your adsapi_php.ini file.* > * // Construct an API session configured from a properties file and > the OAuth2* > * // credentials above.* > * $session = (new AdWordsSessionBuilder())* > * ->fromFile()* > * ->withOAuth2Credential($oAuth2Credential)* > * ->build();* > > * try {* > * self::runExample($session, DownloadFormat::CSV);* > * } catch (\Exception $e) {* > * return array(* > * "status" => "fail",* > * "message" => $e->getMessage()* > * );* > * }* > > * return array(* > * "status" => self::$status,* > * "report" => self::$report,* > * );* > * }* > > > How do I generate the csv? > > >
-- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/ffbf26bc-8884-4660-8162-720d08dd1617%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
