Campaign Conversion Goal Override Returns "account-default" Despite Successful API Call

95 views
Skip to first unread message

dhrutish ramoliya

unread,
Feb 25, 2025, 5:34:54 AM2/25/25
to Google Ads API and AdWords API Forum

Hi everyone,

I'm attempting to override the default conversion goals at the campaign level using the Google Ads API V18. I aim to apply a campaign-specific conversion goal that differs from the account-default conversion goal. However, even though my API call succeeds and the CampaignConversionGoal resources are created, the Google Ads dashboard still displays “account-default” for the campaign conversion goal.

Below is the relevant PHP code snippet from my Laravel controller where I create the conversion goals:

use Google\Ads\GoogleAds\V18\Enums\ConversionActionCategoryEnum\ConversionActionCategory;
use Google\Ads\GoogleAds\V18\Enums\ConversionOriginEnum\ConversionOrigin;
use UnexpectedValueException;

private function applyConversionGoals($googleAdsClient, $customerId, $campaignResourceName, $conversionGoals)
{
    if (empty($conversionGoals)) {
        \Log::warning("⚠️ No conversion goals provided for campaign: " . $campaignResourceName);
        return;
    }

    \Log::info("🔍 Processing Conversion Goals: " . json_encode($conversionGoals));

    $operations = [];

    foreach ($conversionGoals as $goal) {
        if (!isset($goal['category']) || !isset($goal['origin'])) {
            \Log::error("🚨 Missing category or origin in goal: " . json_encode($goal));
            continue;
        }

        $categoryKey = strtoupper($goal['category']);
        $originKey   = strtoupper($goal['origin']);

        // Convert category using enum.
        try {
            $categoryValue = ConversionActionCategory::value($categoryKey);
        } catch (UnexpectedValueException $e) {
            \Log::error("🚨 Invalid conversion category provided: " . $categoryKey);
            continue;
        }

        // Convert origin using enum.
        try {
            $originValue = ConversionOrigin::value($originKey);
        } catch (UnexpectedValueException $e) {
            \Log::error("🚨 Invalid conversion origin provided: " . $originKey);
            continue;
        }

        // Convert biddable flag to boolean.
        $biddable = isset($goal['biddable']) ? filter_var($goal['biddable'], FILTER_VALIDATE_BOOLEAN) : false;

        try {
            $conversionGoal = new CampaignConversionGoal([
                'campaign' => $campaignResourceName,
                'category' => $categoryValue,
                'origin'   => $originValue,
                'biddable' => $biddable,
            ]);

            $operation = new CampaignConversionGoalOperation();
            $operation->setCreate($conversionGoal);
            $operations[] = $operation;
        } catch (\Throwable $th) {
            \Log::error("🔴 Error creating conversion goal for {$categoryKey}: " . $th->getMessage());
        }
    }

    if (empty($operations)) {
        \Log::warning("⚠️ No valid Conversion Goal operations created for campaign: " . $campaignResourceName);
        return;
    }

    try {
        $mutateRequest = new MutateCampaignConversionGoalsRequest([
            'customer_id' => $customerId,
            'operations'  => $operations,
        ]);

        $campaignConversionGoalServiceClient = $googleAdsClient->getCampaignConversionGoalServiceClient();
        $response = $campaignConversionGoalServiceClient->mutateCampaignConversionGoals($mutateRequest);

        \Log::info("✅ Conversion Goals Applied Successfully: " . json_encode($response->getResults()));
    } catch (\Throwable $th) {
        \Log::error("🚨 Google Ads API Error in Conversion Goals: " . $th->getMessage());
    }
}

I'm passing the following JSON payload from my front end:

{
  "campaignBudget": 10000000,
  "campaign": {
    "name": "Test Campaign",
    "status": "PAUSED",
    "type": "SEARCH",
    "start_date": "2025-02-25",
    "end_date": "",
    "locations": [
      {
        "id": 2004,
        "name": "Afghanistan"
      }
    ],
    "languages": [
      {
        "id": 1000,
        "name": "English"
      }
    ],
    "networks": [
      "SEARCH",
      "DISPLAY"
    ],
    "ad_schedule": [],
    "conversion_goals": [
      {
        "category": "PURCHASE",
        "origin": "WEBSITE",
        "biddable": true
      }
    ]
  },
  "adGroup": {
    "name": "Test Ad Group",
    "cpc_bid_micros": 1000000,
    "keywords": [
      "adgpt"
    ]
  },
  "ad": {
    "businessName": "",
    "headlines": [
      "AdGPT - Your AI Ads Manager",
      "AdGPT - Your AI Ads Manager",
      "AdGPT - Your AI Ads Manager"
    ],
    "descriptions": [
      "Boost sales with AdGPT.com for Nike Shoes ads",
      "Boost sales with AdGPT.com for Nike Shoes ads",
      "Boost sales with AdGPT.com for Nike Shoes ads"
    ],
    "final_urls": [
      "adgpt.com"
    ]
  },
  "brand_id": 192
}


When I check the campaign in the Google Ads dashboard, the conversion goal still appears as "account-default" rather than reflecting the override I intended (PURCHASE/WEBSITE).

Questions:

  1. Why does the campaign-level conversion goal override appear as account-default?
    Is it possible that if the override values match the account-level default settings, the UI shows account-default even though the override is applied?

  2. Are there specific conditions (e.g., campaign objective or other settings) that must be met to ensure that the conversion goal override takes effect and is visible in the dashboard?

  3. Is there a propagation delay or a known issue in the Google Ads UI regarding the display of campaign-level conversion goals?

Any insights or suggestions on how to force the dashboard to reflect the campaign-specific conversion goal would be greatly appreciated. Thanks in advance for your help!

Google Ads API Forum Advisor

unread,
Feb 25, 2025, 9:25:38 AM2/25/25
to dhrutish...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team. 

Based on the information provided, I understand that you are attempting to override the default conversion goals at the campaign level using the Google Ads API V18 and facing issues. Please find the answers for your questions below: 

1. Why does the campaign-level conversion goal override appear as account-default? Is it possible that if the override values match the account-level default settings, the UI shows account-default even though the override is applied?

  • Google Ads automatically creates CustomerConversionGoal objects. You can set the biddable attribute for each goal to determine whether it should be an account-default goal. Set biddable to true if Google Ads should optimize for conversion actions based on the goal's category and origin. Otherwise, set it to false. The values true and false correspond to the "Use as an account-default goal" and "Do not use as an account-default goal" options in the conversion action settings, respectively. I would recommend you to refer to this guide for more detailed information. 

2. Are there specific conditions (e.g., campaign objective or other settings) that must be met to ensure that the conversion goal override takes effect and is visible in the dashboard?

  • No, there are no specific conditions other than setting the 'biddable' field to false. Upon checking the request body, I could see that you have set the 'biddable' field to 'true' under the conversion_goal which will automatically set the account default conversion goals. 

3. Is there a propagation delay or a known issue in the Google Ads UI regarding the display of campaign-level conversion goals?

  • No, there is no propagation delay or any issues in the Google Ads UI regarding the campaign level conversion goals. I would recommend you to refer to the documentation which explains the step by step process in applying the custom goals to campaign using the Google Ads API. 
 

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-02-25 14:25:01Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vH3om:ref" (ADR-00289727)



dhrutish ramoliya

unread,
Feb 26, 2025, 3:23:08 AM2/26/25
to Google Ads API and AdWords API Forum
Getting error

"error": "Call to undefined method Google\\Ads\\GoogleAds\\V18\\Services\\CampaignConversionGoalOperation::setCreate()"



private function applyConversionGoals($googleAdsClient, $customerId, $campaignResourceName, $conversionGoals)
{
if (empty($conversionGoals)) {
Log::warning("⚠️ No conversion goals provided for campaign: " . $campaignResourceName);
return;
}

Log::info("🔍 Processing Conversion Goals: " . json_encode($conversionGoals));

$operations = [];

foreach ($conversionGoals as $goal) {
if (!isset($goal['category']) || !isset($goal['origin'])) {
Log::error("🚨 Missing category or origin in goal: " . json_encode($goal));
continue;
}

$categoryKey = strtoupper($goal['category']);
$originKey = strtoupper($goal['origin']);

// Convert the category using the ConversionActionCategory enum.
try {
$categoryValue = ConversionActionCategory::value(strtoupper($goal['category']));
} catch (UnexpectedValueException $e) {
Log::error("🚨 Invalid conversion category provided: " . $categoryKey);
continue;
}

// Convert the origin using the ConversionOrigin enum.
try {
$originValue = ConversionOrigin::value($originKey);
} catch (UnexpectedValueException $e) {
Log::error("🚨 Invalid conversion origin provided: " . $originKey);
continue;
}

// Convert biddable flag to boolean.
$biddable = isset($goal['biddable']) ? filter_var($goal['biddable'], FILTER_VALIDATE_BOOLEAN) : false;

try {
$conversionGoal = new CampaignConversionGoal([
'campaign' => $campaignResourceName,
'category' => $categoryValue,
'origin' => $originValue,
'biddable' => false,
]);

$operation = new CampaignConversionGoalOperation();
$operation->setCreate($conversionGoal);
$operations[] = $operation;
} catch (\Throwable $th) {
throw new Exception($th->getMessage());
Log::error("🔴 Error creating conversion goal for {$categoryKey}: " . $th->getMessage());
}
}

if (empty($operations)) {
throw new Exception("No valid Conversion Goal operations created for campaign: " . $campaignResourceName);
Log::warning("⚠️ No valid Conversion Goal operations created for campaign: " . $campaignResourceName);
return;
}

try {
$mutateRequest = new MutateCampaignConversionGoalsRequest([
'customer_id' => $customerId,
'operations' => $operations,
]);

$campaignConversionGoalServiceClient = $googleAdsClient->getCampaignConversionGoalServiceClient();
$response = $campaignConversionGoalServiceClient->mutateCampaignConversionGoals($mutateRequest);

Log::info("✅ Conversion Goals Applied Successfully: " . json_encode($response->getResults()));
} catch (\Throwable $th) {
throw new Exception("🚨 Google Ads API Error in Conversion Goals: ". $th->getMessage());
Log::error("🚨 Google Ads API Error in Conversion Goals: " . $th->getMessage());
}
}

Google Ads API Forum Advisor

unread,
Feb 26, 2025, 5:09:08 AM2/26/25
to dhrutish...@gmail.com, adwor...@googlegroups.com

Hi,

To assist you further, kindly provide us with complete API logs (request and response logs with request-id and request header) generated at your end

If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-02-26 10:08:34Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02vH3om:ref" (ADR-00289727)



Reply all
Reply to author
Forward
0 new messages