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_action

The 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/web

With 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!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/90d4bf70-859c-49a5-8a9e-5ca62cffc040n%40googlegroups.com.

Reply via email to