google-ads-php: Missing request Id when we upload offline conversions

Your question: We are currently migrating our project from Google Ads API V15 to V16 with the release of Google Ads PHP 22.1.0.

In our application, we used to log the RequestID whenever we sent offline conversions to Google Ads API. (both success calls as well as failed calls)

We used the following code when we used V15.

use Google\Ads\GoogleAds\V15\Services\ConversionUploadServiceClient;

 /** @var UploadClickConversionsResponse $response */
[$response,$status] = $conversionUploadService->uploadClickConversions( 
    $customerId,
    $conversions,
    true,
    ['withResponseMetadata' => true],
);

The $status is the GoogleAdsResponseMetadata where we can get the request-id.

Problem

With V16 the above code is NOT working anymore. So we have updated the code to the following

use Google\Ads\GoogleAds\V16\Services\Client\ConversionUploadServiceClient;

$response = $conversionUploadService->uploadClickConversions(
        UploadClickConversionsRequest::build($customerId, $conversions, true),
 );

With this code, we missed the entire GoogleAdsResponseMetadata object.

How can we get the request Id with new version (V16)? (both success calls as well as failed calls)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (13 by maintainers)

Most upvoted comments

We’ve just updated the doc. Sorry for your inconvenience.

@dabontv I am still stuck around this issue, were you able to find a workaround?

We set up our own logs (https://developers.google.com/google-ads/api/docs/client-libs/php/logging)

Using v17 example:

        $conversionUploadServiceClient = $googleAdsClient->getConversionUploadServiceClient();
        $response = $conversionUploadServiceClient->uploadClickConversions(
            UploadClickConversionsRequest::build($customerId, $clickConversion, true),
            ['withResponseMetadata' => true]
        );

$conversionUploadServiceClient->getResponseMetadata(); will return null