I need to fetch:

  1. Name of the campaign.
  2. Impressions.
  3. Cost.
  4. Conversation Rate.
  5. Conversions.
  6. Date.
  7. Budget.
  8. Image/Video of this ad.

Can I fetch it all from campaign entity? How?

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient(); // Creates a query that retrieves all campaigns. $query = 'SELECT [MYLIST]  FROM campaign ORDER BY campaign.name'; // Issues a search stream request. /** @var GoogleAdsServerStreamDecorator $stream */ $stream = $googleAdsServiceClient->searchStream($customerId, $query); // Iterates over all rows in all messages and prints the requested field values for // the campaign in each row. foreach ($stream->iterateAllElements() as $googleAdsRow) {     /** @var GoogleAdsRow $googleAdsRow */     printf(         "Campaign with ID %d and name '%s' was found.%s",         $googleAdsRow->getCampaign()->getId(),         $googleAdsRow->getCampaign()->getName(),         AND SOMETHING HERE         PHP_EOL     ); } 

Tag:google-ads-api, php

Only one comment.

  1. Dave Davis

    There's no way to get an image of the ad back. But you can call the ads report and get the ad elements back and present it any way you like.

    Me, I'd pull the ad content and use something like carbon to generate an image.

Add a new comment.