You have to specify customer id in $user: $user->setClientCustomerId('XXX');
On Monday, October 7, 2013 6:13:04 PM UTC+2, Rishi wrote: > > Getting "The client customer ID must be specified for report downloads" > while tring to download the keywordsPerformance report. > > This is what I have on the file: > > function DownloadCriteriaReportExample(AdWordsUser $user, $filePath) { > // Load the service, so that the required classes are available. > $user->LoadService('ReportDefinitionService', ADWORDS_VERSION); > > // Create selector. > $selector = new Selector(); > $selector->fields = array('CampaignId', 'AdGroupId', 'Id', 'Criteria', > 'CriteriaType', 'Impressions', 'Clicks', 'Cost'); > > // Filter out deleted criteria. > $selector->predicates[] = new Predicate('Status', 'NOT_IN', > array('DELETED')); > > // Create report definition. > $reportDefinition = new ReportDefinition(); > $reportDefinition->selector = $selector; > $reportDefination->clientCustomerId = '715-625-1143'; > $reportDefinition->reportName = 'Criteria performance report #' . > uniqid(); > $reportDefinition->dateRangeType = 'LAST_7_DAYS'; > $reportDefinition->reportType = 'CRITERIA_PERFORMANCE_REPORT'; > $reportDefinition->downloadFormat = 'CSV'; > > // Exclude criteria that haven't recieved any impressions over the date > range. > $reportDefinition->includeZeroImpressions = FALSE; > > // Set additional options. > $options = array('version' => ADWORDS_VERSION, 'clientCustomerId' => > '7156251143', 'returnMoneyInMicros' => TRUE); > > // Download report. > ReportUtils::DownloadReport($reportDefinition, $filePath, $user, > $options); > > printf("Report with name '%s' was downloaded to '%s'.\n", > $reportDefinition->reportName, $filePath); > } > > > 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(); > //$user->GetAuthToken(); > // Load the oAuth settings > $user->SetOAuth2Info(); > //$user->SetOAuth2Info(loadAuth($tokenFilename)); > > > // 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()); > } > > Please advise. > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.