how to add imges or video to ad group

44 views
Skip to first unread message

zheng william

unread,
Apr 24, 2024, 8:56:38 AM4/24/24
to Google Ads API and AdWords API Forum
Hi ,
I want to add a exit image or video to exist ad grouop. and  i am using the api "https://googleads.googleapis.com/v15/customers/8656609886/adGroupAssets:mutate" . but this api return below error :
          "errorCode": {
              "assetLinkError": "UNSUPPORTED_FIELD_TYPE"
            },
            "message": "The given field type is not supported to be added directly through asset links.",
            "trigger": {
              "stringValue": "MARKETING_IMAGE"
            }

Below is my sample code which using golang:
operations := make([]*services.AdGroupAssetOperation, 0)
adGroupAd := resources.AdGroupAsset{}
adGroupAd.AdGroup = "customers/xxxxxx/adGroups/166011065928"
adGroupAd.Asset = "customers/xxxxxx/assets/128153732981"
adGroupAd.FieldType = enums.AssetFieldTypeEnum_YOUTUBE_VIDEO

adGroupAdOperation_create := services.AdGroupAssetOperation_Create{}
adGroupAdOperation_create.Create = &adGroupAd

operation := services.AdGroupAssetOperation{}
operation.Operation = &adGroupAdOperation_create
operations = append(operations, &operation)

req := services.MutateAdGroupAssetsRequest{}

req.Operations = operations
req.CustomerId = "xxxxxx"
requestBody, err := protojson.Marshal(&req)
if err != nil {
panic(err)
}
//fmt.Println(requestBody)
request, err := http.NewRequest("POST", "https://googleads.googleapis.com/v15/customers/xxxxxx/adGroupAssets:mutate", bytes.NewBuffer(requestBody))
if err != nil {
panic(err)
}

please help.

Thanks.

Google Ads API Forum Advisor

unread,
Apr 24, 2024, 9:26:18 AM4/24/24
to zhenggu...@gmail.com, adwor...@googlegroups.com

Hi,

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

From the provided sample code, I could see that you are getting the error "UNSUPPORTED_FIELD_TYPE". This means that the field type 'MARKETING_IMAGE' is not supported to be added directly through asset links. Please refer to this guide to know the asset types that can be linked to customers, campaigns, or ad groups through linkage objects. According to our API documentation, you can link the 'MARKETING_IMAGE' image asset directly to the Ad and you may use AdService to achieve this via the API.

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

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages