User deprecated logsink - Google Ads API Beta

9 views
Skip to first unread message

ja...@searchkings.ca

unread,
Feb 27, 2019, 5:13:03 PM2/27/19
to AdWords API and Google Ads API Forum
Getting an error exception in the Ads beta PHP library: User Deprecated: Google\Cloud\Logging\V2\LogSink_VersionFormat is deprecated and will be removed in the next major release. Use Google\Cloud\Logging\V2\LogSink\VersionFormat instead

Here's the example code: 

public static function runExample(GoogleAdsClient $googleAdsClient, $customerId)
   {
       $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
       // Creates a query that retrieves all campaigns.
       $query = 'SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id';
       // Issues a search request by specifying page size.
       $response =
           $googleAdsServiceClient->search($customerId, $query, ['pageSize' => self::PAGE_SIZE]);
       // Iterates over all rows in all pages and prints the requested field values for
       // the campaign in each row.
       foreach ($response->iterateAllElements() as $googleAdsRow) {
           /** @var GoogleAdsRow $googleAdsRow */
           printf(
               "Campaign with ID %d and name '%s' was found.%s",
               $googleAdsRow->getCampaign()->getId()->getValue(),
               $googleAdsRow->getCampaign()->getName()->getValue(),
               PHP_EOL
           );
       }

Seems like I avoid the error if my $customerId is set to my main MCC account whereas if I use any other customerIds (e.g. accounts nested inside the MCC), it'll throw.




Reply all
Reply to author
Forward
0 new messages