Get some error in mutateAccountBudgetProposal

68 views
Skip to first unread message

Myung Ju Park

unread,
Mar 30, 2022, 5:04:20 AM3/30/22
to adwor...@googlegroups.com, Terry(이태석), Gioh Heo
Hi!

I implement AccountBudgetProposal instead to BudgetOrder in Adword API cause migrate to Ads API.
However, when I execute to AccountBudgetProposal then I get some error.
Below message is my error message.
{
  "message": "Request contains an invalid argument.",
  "code": 3,
  "status": "INVALID_ARGUMENT",
  "details": [
    {
      "@type": "google.ads.googleads.v10.errors.googleadsfailure-bin",
      "data": "<Unknown Binary Data>"
    },
    {
      "@type": "grpc-status-details-bin",
      "data": "<Unknown Binary Data>"
    },
    {
      "@type": "request-id",
      "data": "htxpogqxiz1oNVAxrA-9aA"
    }
  ]
}

Below code is my implementation code.
private static function getBillingSetupID(GoogleAdsClient $googleAdsClient, $data)
{
   $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
   $query = 'SELECT billing_setup.id, billing_setup.status, billing_setup.payments_account_info.payments_account_id, billing_setup.payments_account_info.payments_account_name, billing_setup.payments_account_info.payments_profile_id, billing_setup.payments_account_info.payments_profile_name, billing_setup.payments_account_info.secondary_payments_profile_id FROM billing_setup';

   $response = $googleAdsServiceClient->search($data["clientCustomerID"], $query);

   foreach ($response->iterateAllElements() as $googleAdsRow) {
       $paymentAccountInfo = $googleAdsRow->getBillingSetup()->getPaymentsAccountInfo();
       if (is_null($paymentAccountInfo)) {
           continue;
       }
       return $googleAdsRow->getBillingSetup()->getId();
   }
}

private static function createBudgetOrder(GoogleAdsClient $googleAdsClient, $data)
{
        $accountBudgetProposal = new AccountBudgetProposal([
            'billing_setup' => ResourceNames::forBillingSetup($data["clientCustomerID"], self::getBillingSetupID($googleAdsClient, $data)),
            'proposal_type' => AccountBudgetProposalType::CREATE,
            'proposed_start_time_type' => TimeType::NOW,
            'proposed_end_time_type' => TimeType::FOREVER,
            'proposed_spending_limit_micros' => $data["amount"]*1000000
        ]);

        $accountBudgetProposalOperation = new AccountBudgetProposalOperation();
        $accountBudgetProposalOperation->setCreate($accountBudgetProposal);

        $accountBudgetProposalServiceClient = $googleAdsClient->getAccountBudgetProposalServiceClient();
        $response = $accountBudgetProposalServiceClient->mutateAccountBudgetProposal(
            $data["clientCustomerID"],
            $accountBudgetProposalOperation
        );
        return $response->getResult(); 
}

public static function main($action, $data)
{
        $oAuth2Credential = (new OAuth2TokenBuilder())->withClientId(config('AdsConfig')->CLIENT_ID)->withClientSecret(config('AdsConfig')->CLIENT_SECRET)->withRefreshToken(config('AdsConfig')->REFRESH_TOKEN)->build();

        $googleAdsClient = (new GoogleAdsClientBuilder())->withDeveloperToken(config('AdsConfig')->DEVELOPER_TOKEN)->withOAuth2Credential($oAuth2Credential)->withLoginCustomerId(config('AdsConfig')->CLIENT_CUSTOMER_ID)->build();

        return self::{$action}($googleAdsClient, $data);
}

Below values are using each variables in above codes.
$action = "createBudgetOrder";
$data["clientCustomerID"] = "6357610105";
$data["amount"] = 5000;
returned value is 6733533069 from self::getBillingSetupID function.

That error appeared at mutateAccountBudgetProposal function.

Please let me know, how to solve that error.

Best regards.

Google Ads API Forum Advisor

unread,
Mar 30, 2022, 11:45:57 PM3/30/22
to taes...@gmail.com, l...@gabia.com, gio...@google.com, adwor...@googlegroups.com
Hi Myung Ju,

Thank you for reaching out to our API support team and for these details you sent over.

However, for our team to be able to take a closer look into the error you encountered, could you also provide to our team the complete request and response logs? If you haven't yet, and since it appears you are using PHP, you may refer to this guide (use DEBUG) to enable logging.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZI0QK:ref

Google Ads API Forum Advisor

unread,
Apr 1, 2022, 9:48:17 AM4/1/22
to taes...@gabia.com, p...@gabia.com, l...@gabia.com, gio...@google.com, adwor...@googlegroups.com
Hi Myung Ju,

Thank you for sending us the log. You are attempting to create a budget proposal using a cancelled billing setup with Id 6733533069. Could you try with an active billing setup available for this account?

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZI0QK:ref

Google Ads API Forum Advisor

unread,
Apr 4, 2022, 11:11:34 AM4/4/22
to taes...@gabia.com, p...@gabia.com, l...@gabia.com, gio...@google.com, adwor...@googlegroups.com
Hi there,

Could you privately send us a full screen screenshot of the UI showing the link to help page in a report screen? 

Google Ads API Forum Advisor

unread,
Apr 5, 2022, 1:56:21 AM4/5/22
to taes...@gabia.com, p...@gabia.com, l...@gabia.com, gio...@google.com, adwor...@googlegroups.com
Hi,

Thank you for providing more details to your concern. I am also a member of the Google Ads API team and let me provide support to your concern.

I can see that you also have an issue with the migration of the BudgetOrderService into AccountBudgetProposal. So that I can investigate it as well, would you be able to provide more details here "billing_setup.id field same to billing setup ID for AccountBudgetProposal ... that was not correct for AccountBudgetProposal.", so that we can have a clearer view on the issue that you mentioned there?

As for the equivalent field of getPolicyTopicHelpCenterUrl in the Google Ads API, you can use the ad_group_ad.policy_summary.policy_topic_entries field of the ad_group_ad. You may try it on your end and let me know if this is what you are looking for.

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZI0QK:ref

Google Ads API Forum Advisor

unread,
Apr 5, 2022, 10:21:34 AM4/5/22
to taes...@gabia.com, p...@gabia.com, l...@gabia.com, gio...@google.com, adwor...@googlegroups.com
Hi there,

Thank you for clarifying and for the log.  I raised with my team your being blocked from creating an account budget in the new API because you cannot access the MCC based billing setups. We will get back to you on this as soon as possible.

I also raised with my team your request to expose the policy based disapproval URL in the Ads API, just like it was in the AdWords API and should be accessible from the UI.  This request is subject to review. You may monitor our blog for an update.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2ZI0QK:ref
Reply all
Reply to author
Forward
0 new messages