Can't get The report when set clirntCustomerId to varable.

20 views
Skip to first unread message

deadKenny2

unread,
Jun 11, 2015, 1:59:45 PM6/11/15
to adwor...@googlegroups.com
Try to get Report for each company in MCC like this

$cmps = file(dirname(__FILE__).'/../../../../companies.txt');
  //print_r($cmps);
  foreach ($cmps as $i=>$c){
  list($cname,$cid) = explode(',',$c);
  $user = new AdWordsUser();
    //print_r($cid);
    $user->SetClientCustomerId($cid);
  // 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'.$i.'.csv';

  // Run the example.
  DownloadCriteriaReportExample($user, $filePath);
}

Answer is "An error has occurred: Report download failed."

When I pas to SetClientCustomerId not a variable, just sting like $user->SetClientCustomerId('3xx-xx-xxx4') reports are downloaded succesfully.

Umesh Dengale

unread,
Jun 11, 2015, 5:22:27 PM6/11/15
to adwor...@googlegroups.com, grach...@yandex.ru
Hello,

Please make sure value of variable is properly formatted (e.g., trimmed, no trailing newlines, quotes, etc.). Please use var_dump ($cid) to get more details.

Cheers,
Umesh Dengale, AdWords API Team.

deadKenny2

unread,
Jun 12, 2015, 2:06:30 AM6/12/15
to adwor...@googlegroups.com, grach...@yandex.ru
Trimed work properly, thanks.
Reply all
Reply to author
Forward
0 new messages