How to get total impressions, total cost, total click for a customer?

34 views
Skip to first unread message

Balbinder Sumbria

unread,
Jan 22, 2018, 2:47:01 AM1/22/18
to AdWords API Forum

I don
't know even where to start.  The documentation have no head no feet. There is no proper example. Everywhere there is same copy and paste of samples. I just want to retrieve otal clicks, total impressions, total cost for a customer for all campaings but I can't find any option. you have to include 100 classes in order to retrieve one thing. Now I tried:

$reportQuery = 'SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, '
                      . 'Impressions, Clicks, Cost FROM CRITERIA_PERFORMANCE_REPORT '
                      . 'WHERE Status IN [ENABLED, PAUSED] DURING LAST_7_DAYS';
              $reportDownloader = new \Google\AdsApi\AdWords\Reporting\v201710\ReportDownloader($session);
              $reportSettingsOverride = (new \Google\AdsApi\AdWords\ReportSettingsBuilder())
                      ->includeZeroImpressions(false)
                      ->build();
              $reportDownloadResult = $reportDownloader->downloadReportWithAwql(
                      $reportQuery, \Google\AdsApi\AdWords\Reporting\v201710\DownloadFormat::XML, $reportSettingsOverride);
              print_r($reportDownloadResult);
And I have follwing setting added for  $session         $soapSettings = (new \Google\AdsApi\Common\SoapSettingsBuilder())
           ->disableSslVerify()
          ->build();

And getting following error:
Error creating resource: [message] fopen(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed [file]

Peter Oliquino

unread,
Jan 22, 2018, 3:45:35 AM1/22/18
to AdWords API Forum
Hi Balbinder,

For account level information or statistics, I would recommend that you use the Account Performance Report instead of the Criteria Performance Report, since the criteria report focuses mainly on criterion level statistics.

As for your SSL certificate issue, this error might be due to you using a lower PHP version. Could you try and upgrade your PHP version (PHP 5.5.9 and higher) and see if the issue persists? If it does, I would recommend that you contact directly the PHP client library owners via this link as they are more equipped to assist you regarding this matter.

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages