https://nimb.ws/JL3FY4E
Here is the screenshot of ads dashboard. Following is the request method: public static function getGoogleAdCampaigns(GoogleAdsClient $googleAdsClient, int $customerId, $startDate, $endDate) { $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient(); $query = "SELECT campaign.id, campaign.name,campaign.status, metrics.impressions,metrics.interactions, metrics.clicks, metrics.conversions, metrics.ctr, metrics.average_cpc, metrics.cost_micros FROM campaign WHERE segments.date >= '$startDate' AND segments.date <= '$endDate'"; /** @var GoogleAdsServerStreamDecorator $stream */ $stream = $googleAdsServiceClient->searchStream( SearchGoogleAdsStreamRequest::build($customerId, $query) ); $campaigns = []; foreach ($stream->iterateAllElements() as $googleAdsRow) { /** @var GoogleAdsRow $googleAdsRow */ $campaigns[] = [ 'id' => $googleAdsRow->getCampaign()->getId(), 'name' => $googleAdsRow->getCampaign()->getName(), 'status' => $googleAdsRow->getCampaign()->getStatus(), 'impressions' => $googleAdsRow->getMetrics()->getImpressions(), 'clicks' => $googleAdsRow->getMetrics()->getClicks(), 'conversions' => $googleAdsRow->getMetrics()->getConversions(), 'ctr' => $googleAdsRow->getMetrics()->getCtr(), 'average_cpc' => $googleAdsRow->getMetrics()->getAverageCpc(), 'cost_micros' => $googleAdsRow->getMetrics()->getCostMicros(), 'interactions' => $googleAdsRow->getMetrics()->getInteractions(), 'revenue_micros' => $googleAdsRow->getMetrics()->getRevenueMicros(), ]; } echo json_encode($campaigns); exit(); } On Wednesday, May 22, 2024 at 7:53:19 PM UTC+5:30 Google Ads API Forum Advisor wrote: > Hi, > > Thank you for reaching out to the Google Ads API support team. > > Kindly provide us with the uncropped screenshot of the Google Ads account > where the values are showing zero and updated complete API logs (request > <https://developers.google.com/google-ads/api/docs/concepts/field-service#request> > and response > <https://developers.google.com/google-ads/api/docs/concepts/field-service#response> > with request-id > <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id> > and request header > <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>) > > generated at your end so that we can investigate why > the metrics.conversations are not returned via the API. > > If you are using a client library and haven't enabled the logging yet, I > would request you to enable logging for the specific client library that > you are using. You can refer to the guides Java > <https://developers.google.com/google-ads/api/docs/client-libs/java/logging> > , .Net > <https://developers.google.com/google-ads/api/docs/client-libs/dotnet/logging> > , PHP > <https://developers.google.com/google-ads/api/docs/client-libs/php/logging> > , Python > <https://developers.google.com/google-ads/api/docs/client-libs/python/logging> > , Ruby > <https://developers.google.com/google-ads/api/docs/client-libs/ruby/logging> > or Perl > <https://developers.google.com/google-ads/api/docs/client-libs/perl/logging> > to > enable logging at your end. For REST interface requests, you can enable > logging via the curl command by using the -i flag. > > You can send the details via *Reply privately to the author option*, or > *direct > private reply* to this email. > > This message is in relation to case > "ref:!00D1U01174p.!5004Q02nqkUS:ref" (ADR-00192758) > > > Thanks, > > [image: Google Logo] Google Ads API Team > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads 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 "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/d2609889-dae9-45f2-b9f8-8afc344c2092n%40googlegroups.com.