enhancing conversion via api errors with 'conversion action not active'.

106 views
Skip to first unread message

Grant Horwood

unread,
Nov 23, 2023, 3:59:53 PM11/23/23
to Google Ads API and AdWords API Forum
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!

Google Ads API Forum Advisor

unread,
Nov 24, 2023, 2:00:19 AM11/24/23
to ghor...@fruitbat.studio, adwor...@googlegroups.com
Hi,

Thank you for contacting the Google Ads API support team.

After reviewing your concern, I see that you have already raised this concern on another thread with the subject "enhancing conversion via api errors with 'conversion action not active", and we have already responded there for this issue. To avoid multiple threads on the same issue, please take a look at that thread and continue the discussion on the same for further updates on the issue.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02qUhH1:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages