Hi,
I am attempting to enhance an existing conversion in google using the php sdk, however the the call to `uploadConversionAdjustments()` returns the error from google:
Make sure you specify an active conversion action that can be adjusted., at conversion_adjustments[0].conversion_actionThe conversion action I am using is:
{
"id": 669121XXXX,
"name": "XXXX",
"category_id": 13,
"category_name": "SUBMIT_LEAD_FORM",
"type_id": 7,
"type_name": "UPLOAD_CLICKS",
"status_id": 2,
"status_name": "ENABLED"
}(some values redacted)
My version of the google ads sdk is:
"googleads/google-ads-php": "19.2"
and I am using V14.
My questions are:1. What is the difference between an 'active' conversion action and one that is not 'active'?
2. How can I tell the difference before attempting to enhance?
3. Is this documented anywhere for future reference?
I am following the procedure for enhancing a conversion that is outlined here:
https://developers.google.com/google-ads/api/docs/conversions/enhanced-conversions/webWith some differences, described at the bottom.
My salient code is:
$conversionActionResource = ResourceNames::forConversionAction($customerId, $conversionActionId);
$enhancement = new ConversionAdjustment(
[
'conversion_action' => $conversionActionResource,
'adjustment_type' => ConversionAdjustmentType::ENHANCEMENT,
'order_id' => $orderId,
]
);
$userIdentifiers = [];
if(!is_null($email)) {
$userIdentifiers[] = new UserIdentifier([
'hashed_email' => $this->normalizeAndHashEmailAddress('sha256', $email), // normalizeAndHashEmailAddress() is from the example code
'user_identifier_source' => UserIdentifierSource::FIRST_PARTY,
]);
}
if(count($userIdentifiers) > 0) {
$enhancement->setUserIdentifiers($userIdentifiers);
$enhancement->setGclidDateTimePair(
new GclidDateTimePair(['conversion_date_time' => $conversionDateTime,])
);
$googleAdsClient = $this->getAdsClientByAgencyClientId($agencyClientId, $customerId, $ganderId); // googleAdsClient is built as per the example
$conversionAdjustmentUploadServiceClient = $googleAdsClient->getConversionAdjustmentUploadServiceClient();
$response = $conversionAdjustmentUploadServiceClient->uploadConversionAdjustments($customerId, [$enhancement], true); // see notes below
}The differences between my code and the official example are:
1. The official example has `uploadConversionAdjustments()` taking one argument, an instance of `UploadConversionAdjustmentsRequest`, however inspection of the source code in my vendor directory shows that `uploadConversionAdjustments()` requires the three arguments.
Thanks in advance!