Unable to find REST docs for Performance max campaigns

111 views
Skip to first unread message

Darshan Dhabale

unread,
Jul 29, 2024, 5:17:29 AM7/29/24
to Google Ads API and AdWords API Forum
I have a go application, I am using the REST interface to create ads. I am unable to find REST docs for Performance max campaigns.
Please point me in their direction. Thanks.

Google Ads API Forum Advisor

unread,
Jul 29, 2024, 12:13:14 PM7/29/24
to dhabale...@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 would like to create campaigns for your Google Ads account. I would suggest referring to this document to create campaigns using the REST interface through the Google Ads API.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vEHGt:ref" (ADR-00259937)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Darshan Dhabale

unread,
Jul 31, 2024, 4:35:42 AM7/31/24
to Google Ads API and AdWords API Forum
Thanks for your response.
The particular type of campaign that I am unable to create is - "Performance Max Campaign"
Here is the request I am trying
curl --location 'https://googleads.googleapis.com/v17/customers/4926841893/campaigns:mutate' \
--header 'developer-token: hN6dsqjNmj3tWdITcPd_Qg' \
--header 'login-customer-id: 3263459376' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ya29.a0AXooCgtMIpcIeRjl2Bm544l7KM6R_7gin4V4AhTuIhjH-ZtBovo-JD17RCfjth6PWd3qgtW5llr0ycjuvjL_ENFjGtSH9pacdY5vIKj4WmsUufeEw9kBdj8tsKtCpw-G6nvSxzbuE9FxYH7LwyohDeSuuxWJCHUX_ZU9aCgYKAV4SARMSFQHGX2MinpYLgJAs6edb9IJAnh5Y1Q0171' \
--data '{
    "operations": [
        {
            "create": {
                "name": "A performance max campaign 1",
                "status": "PAUSED",
                "campaignBudget": "customers/4926841893/campaignBudgets/13770369729",
                "advertisingChannelType": "PERFORMANCE_MAX",
                "target_spend": {}
            }
        }
    ]
}'

and here is the response
{
    "error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com/google.ads.googleads.v17.errors.GoogleAdsFailure",
                "errors": [
                    {
                        "errorCode": {
                            "contextError": "OPERATION_NOT_PERMITTED_FOR_CONTEXT"
                        },
                        "message": "The operation is not allowed for the given context.",
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                },
                                {
                                    "fieldName": "create"
                                },
                                {
                                    "fieldName": "target_spend"
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "campaignError": "INCOMPATIBLE_BUDGET_TYPE"
                        },
                        "message": "The type of the budget is not compatible with this campaign.",
                        "trigger": {
                            "int64Value": "13770369729"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                },
                                {
                                    "fieldName": "create"
                                },
                                {
                                    "fieldName": "campaign_budget"
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "campaignError": "NOT_COMPATIBLE_WITH_BUDGET_TYPE"
                        },
                        "message": "The field is not compatible with the budget type.",
                        "trigger": {
                            "int64Value": "13770369729"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                },
                                {
                                    "fieldName": "create"
                                },
                                {
                                    "fieldName": "campaign_budget"
                                }
                            ]
                        }
                    }
                ],
                "requestId": "IneV2A0Pw3SWDgbquPoEPw"
            }
        ]

Google Ads API Forum Advisor

unread,
Jul 31, 2024, 10:52:48 AM7/31/24
to dhabale...@gmail.com, adwor...@googlegroups.com
Hi,

As per logs, I could see that you are getting OPERATION_NOT_PERMITTED_FOR_CONTEXT error while creating the performance max campaign. In order to avoid the said error, kindly create appropriate bidding strategies as for Pmax campaigns the only applicable bidding strategies are 'Maximize Conversions' and 'Maximize conversion values' and for Pmax campaigns while creating the campaign budgets make sure that "explicitlyShared": false. Also refer to the video for more information.

Kindly refer to the below sample request for creating Pmax campaign using campaignOperation:
{
  "operations": [
    {
      "create": {
        "name": "A performance max campaign 1",
        "campaignBudget": "customers/{customerId}/campaignBudgets/{campaign_budget_id}",
        "advertisingChannelType": "PERFORMANCE_MAX",
        "maximizeConversions": {
          "targetCpaMicros": xxxxx
        }
      }
    }
  ]
}

I tried to create the Pmax campaign by my end and was able to get the results. So, I would suggest you to try the above request from your end and let us know, how this goes on your end.

 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vEHGt:ref" (ADR-00259937)

Thanks,
 
Google Logo Google Ads API Team


 

Darshan Dhabale

unread,
Aug 5, 2024, 4:52:30 AM8/5/24
to Google Ads API and AdWords API Forum
Thanks for the help
I was able to create the performance max campaign with that budding strategy
Reply all
Reply to author
Forward
0 new messages