how to change campaign settings in performance max campaign

494 views
Skip to first unread message

Jip Veerbeek

unread,
Oct 28, 2022, 7:38:36 AM10/28/22
to Google Ads API and AdWords API Forum
Hello,

I have tried to change this information with a CURL request.

ssssssssssssssssssss2022-10-28 133350.jpg

I have tried to use this: local_campaign_setting parameter that contain  location_source_type paramer but you can only set up 4 enums:

UNSPECIFIED
No value has been specified.
UNKNOWN
Used for return value only. Represents value unknown in this version.
GOOGLE_MY_BUSINESS
Locations associated with the customer's linked Business Profile.
AFFILIATE
Affiliate (chain) store locations. For example, Best Buy store locations.


I would like to set the Location to US and the language to English.

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Oct 28, 2022, 11:58:48 AM10/28/22
to jip.ve...@gmail.com, adwor...@googlegroups.com

Hello Jip,

Thank you for reaching out to Google Ads support.

To update the language and location campaign settings, you would use the Campaign Criterion resource. For your specific question, the fields to update on that resource are “location” and “language”.

To clarify the “local_campaign_setting” you tried to use refers to Google Ads Local Campaigns which are used to reference physical store information. For Local Campaigns, you select locations by specifying affiliate locations or by linking to your Google My Business account, which correspond with the enum values you shared.

Let us know if you have any other questions.

Regards,

Google Logo
Daniel
Google Ads API Team
 

 

ref:_00D1U1174p._5004Q2fpC2r:ref

Jip Veerbeek

unread,
Oct 31, 2022, 7:11:14 AM10/31/22
to Google Ads API and AdWords API Forum
Hello,

Thanks for the response. This is a CURL request I found on this platform:

zzz.jpg
If I try to use this with v12 I get this error:
Szchermafbeelding 2022-10-31 115833.jpg
And if I follow the instructions in the error I do this:
Szzchermafbeelding 2022-10-31 120503.jpg
And get this:
Szzzchermafbeelding 2022-10-31 120548.jpg

I see that there is a criterion_id requested in the error but I dont have one, do you know if that is necessary? 
It would be great if someone can help me with this problem.

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Oct 31, 2022, 4:18:05 PM10/31/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi Jip,

The criterion_id is need as part of the "resourceName" in some resources and campaignCriteria is one of them.
It is a reference to the criterion value that is set as criteria. For the case of the location field the criteria_id is the value of the "geoTargetConstant".

This is one example query that worked for me using the Geo code you send us.

curl --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/campaignCriteria:mutate" \
--header "Content-Type: application/json" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--data "{
'operations': [
  {
    'create': {
      'resourceName': 'customers/${CUSTOMER_ID}/campaignCriteria/${CAMPAIGN_ID}~9050703',
      'location': { 'geoTargetConstant': 'geoTargetConstants/9050703' },
    },
  }
],
}"

Kindly note the difference in the resourceName to use "campaignCriteria" and the criterion_id.

Let us know if you have any other questions!

Jip Veerbeek

unread,
Nov 1, 2022, 4:23:44 AM11/1/22
to Google Ads API and AdWords API Forum
Hello,

Thanks for the response.

I want to set the location to the US but I dont know where to find the right id.

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Nov 1, 2022, 10:00:20 AM11/1/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hello Jip,

The code for the US is: 2840

The list of Geo Codes can be found on this documentation page: Geo Target. You can get a list by clicking on the "Latest .csv" button.
That file contains a list of all the Geo Codes. You can filter by "Country" in the "Target Type".

Jip Veerbeek

unread,
Nov 1, 2022, 1:29:18 PM11/1/22
to Google Ads API and AdWords API Forum
Hello,

I was wondering if it is possible to change the language and the location in one request.
I have tried it like this:
Swwchermafbeelding 2022-11-01 182521.jpg
And this:
Swwwchermafbeelding 2022-11-01 182645.jpg

And more ways but I can't make it work. 
Thanks for all the help.

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Nov 1, 2022, 5:06:26 PM11/1/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi Jip,

You can have multiple operations in a single request by having multiple valid operation JSON objects in the "operations" field like this:
" \
--header "Content-Type: application/json" \
--header "developer-token: ${DEVELOPER_TOKEN}" \
--header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \
--header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \
--data "{
'operations': [
  {
    'create': {
      'resourceName': 'customers/${CUSTOMER_ID}/campaignCriteria/${CAMPAIGN_ID}~2084',
      'location': { 'geoTargetConstant': 'geoTargetConstants/2084' },
    },
  },
  {
    'create': {
      'resourceName': 'customers/${CUSTOMER_ID}/campaignCriteria/${CAMPAIGN_ID}~1000',
      'language': { 'languageConstant': 'languageConstants/1000' },
    },
  }

],
}"

Regards,

Jip Veerbeek

unread,
Nov 2, 2022, 6:29:02 AM11/2/22
to Google Ads API and AdWords API Forum
Hello,

I am making an assetGroup but I dont know how to fill in the headlines. I also would like to ad images, logos, description and long headlines. How can I do this?

Sxchermafbeelding 2022-11-02 112456.jpg

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Nov 2, 2022, 12:48:44 PM11/2/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi Jip,

To create images, logos headlines and other assets you will create an Asset object.

Kindly note that you will create one Asset objet each asset you want to create (image, text) and you need to use the corresponding type field for each type of asset.
For example, for a text asset you will set the "textAsset" field with an TextAsset object as value.

If you want to link between the different assets you have created and an AssetGroup you have to create an AssetGroupAsset object.

Regards,
Daniel

Jip Veerbeek

unread,
Nov 3, 2022, 11:14:40 AM11/3/22
to Google Ads API and AdWords API Forum
Hello Daniel,

I haven't managed to do it yet, do you maybe have an example?

Thanks,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Nov 4, 2022, 12:45:39 PM11/4/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi Jip,

We don't have full HTTP requests examples but we have multiple examples in the different client libraries that we provide . Since you are doing a lot of operations I would suggest using one of the libraries as they make this process a lot easier.

For your particular question regarding creating an AssetGroup you can see an example using Python here.

Regards,

Jip Veerbeek

unread,
Nov 7, 2022, 7:27:25 AM11/7/22
to Google Ads API and AdWords API Forum
Hello Daniel,

thanks for the suggestion but I am not going to switch yet. 

{
    "operations": [
        {
            "create": {
                "resourceName": "customers/5526191782/assetGroups/-1",
                "campaign": "customers/5526191782/campaigns/18800555689",
                "name": "test1",
                "final_urls": ["https://example.com/"],
                "final_mobile_urls": ["https://example.com/"],
                "status": "PAUSED"
            }
        }
    ]
}

This is my request to create an assetGroup but I keep getting this error:

{
    "error": {
        "code": 400,
        "message": "Request contains an invalid argument.",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "errors": [
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_HEADLINE_ASSET"
                        },
                        "message": "Headline asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: headline"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_LONG_HEADLINE_ASSET"
                        },
                        "message": "Long headline asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: long headline"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_DESCRIPTION_ASSET"
                        },
                        "message": "Description headline asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: description"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_BUSINESS_NAME_ASSET"
                        },
                        "message": "Business name asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: business name"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_MARKETING_IMAGE_ASSET"
                        },
                        "message": "Marketing image asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: marketing image"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_SQUARE_MARKETING_IMAGE_ASSET"
                        },
                        "message": "Square marketing image asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: square marketing image"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "assetGroupError": "NOT_ENOUGH_LOGO_ASSET"
                        },
                        "message": "Logo asset for a valid asset group is not enough.",
                        "trigger": {
                            "stringValue": "Asset type: logo"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    },
                    {
                        "errorCode": {
                            "requestError": "UNKNOWN"
                        },
                        "message": "The error code is not in this version.",
                        "trigger": {
                            "stringValue": "Asset type: description"
                        },
                        "location": {
                            "fieldPathElements": [
                                {
                                    "fieldName": "operations",
                                    "index": 0
                                }
                            ]
                        }
                    }
                ],
                "requestId": "K4RVSdZJrMJpXQyHa_JR2g"
            }
        ]
    }
}

I dont understand why this is going wrong.
It would be great if you could help me with this.

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Nov 7, 2022, 3:11:05 PM11/7/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi Jip,

The errors you are seeing are because your request doesn’t meet the minimum asset requirements for Performance Max campaigns. You may refer to this guide as the Performance Max campaign requires an initial minimum set of assets.

You need to include the creation of the required Assets by the Performance Max campaign in the same request. The operations are described in the Asset Group Asset Service by sending an Asset Group Asset create Operation. In the “field_type” of the Asset Group Asset you can specify the different types of assets as specified in the Asset Field Type page.

Jip Veerbeek

unread,
Nov 14, 2022, 5:35:16 AM11/14/22
to Google Ads API and AdWords API Forum
Hi Daniel,

I still don't get it. Can you maybe provide me with more details?

Regards,

Jip Veerbeek

Google Ads API Forum Advisor

unread,
Nov 15, 2022, 2:02:33 PM11/15/22
to jip.ve...@gmail.com, adwor...@googlegroups.com
Hi Jip,

Performance Max campaigns require certain minimum Assets to be attached to the campaign. You can see all the requirements on this guide.

Using one of your errors as an example:

    "assetGroupError": "NOT_ENOUGH_HEADLINE_ASSET"

This means you are not adding enough Text Assets to the Campaign.
Based on the table from the guide you need a minimum of 3 Text Asset.

On your query you are only sending one create operation for the Campaign but not telling it what assets to use.
 
{
    "operations": [
        {
            "create": {
                 ....
            }
        }
    ]
}

First you need to create these Assets using the Asset endpoint sending an Asset Operation. You will need to do this for all the Assets required.

Then you need to also include the AssetGroupAsset Operations as part of the Campaign request you are sending.
Reply all
Reply to author
Forward
0 new messages