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)
We’ve just updated the doc. Sorry for your inconvenience.
We set up our own logs (https://developers.google.com/google-ads/api/docs/client-libs/php/logging)
Using v17 example:
$conversionUploadServiceClient->getResponseMetadata(); will return null