Error occuring while making asset group assets and asset groups for launching P Max campaign using Rest Api

239 views
Skip to first unread message

Dushyant

unread,
Aug 20, 2024, 4:50:56 AM8/20/24
to Google Ads API and AdWords API Forum
curl --location 'https://googleads.googleapis.com/v17/customers/8702376.../campaigns:mutate' \
--header 'Content-Type: application/json' \
--header 'developer-token: 0-4PjaUzBnyeiqsEkhb...' \
--header 'login-customer-id: 8663393...' \
--header 'Authorization: Bearer ya29.a0AcM612ym1r94_mWDmNoQ5-rG-67OoAi-1Jj-DS5BcZqqGtYf6FWBha6Bt_j96iUu4liInQOY-MjsolKYFDOYI8PZMR9_Xb0m-2YuZTm2nwGyp9xpvOBOauDqDjTuwh1LxCnCAA1YQb50r3GjKMpm4WXu-Pd4s3fQZIUe6waCgYKAagSARMSFQHGX2MidTHNzPMydXz6r7gSqVVuMQ...' \
--data '{
    "operations": [
        {
            "create": {
                "name": "new-PM-campaign",
                "status": "ENABLED",
                "advertisingChannelType": "PERFORMANCE_MAX",
                "campaignBudget": "customers/8702376.../campaignBudgets/13837288...",
                  "biddingStrategyType": "ENHANCED_CPC",
                "maximizeConversionValue": {
                    "targetRoas": 0.9
                }
            }
        }
    ]
}'
The above curl is regarding creating campaign, that i created successfully and i got the response of a resource as customers/8702376.../campaigns/21572158... curl --location 'https://googleads.googleapis.com/v17/customers/8702376.../assetGroupAssets:mutate' \
--header 'Content-Type: application/json' \
--header 'developer-token: 0-4PjaUzBnyeiqsEkhb...' \
--header 'login-customer-id: 8663393...' \
--header 'Authorization: Bearer ya29.a0AcM612xKADH3bA8Db-er8Lk7wqYeF7QPkFu5SI1CH0wK0Nu2hMN41-cM6fM7mX_cv_emBzugBdv23lh0ZObrIHQnmzZ9wzjjK7gDWZwhh7LUjO40Pyq_sx5fc8M7XsK4Uqz9rZpBgsMqpIsNXj7xNFq1cwZ-XHGO3rjGcwIZ9QaCgYKAeQSARMSFQHGX2Mix_Ts_Ndx2xXMb9EahGR5IQ0...' \
--data '{
    "operations": [
        {
            "create": {
                "assetGroup": "customers/8702376.../assetGroups/-1",
                "asset": "customers/8702376.../assets/156759927...",
                "fieldType": "HEADLINE"
            }
        },
        {
            "create": {
                "assetGroup": "customers/8702376.../assetGroups/-1",
                "asset": "customers/8702376.../assets/156746501...",
                "fieldType": "AD_IMAGE"
            }
        }
    ]
}'
then this above is the curl regarding making of asset group assets . as i have not made asset group so i used temporary id to refer it for future . i am getting an error below as it is not considering the asset group resource with the temporary id that i mentioned here
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT",
"details": [
{
"errors": [
{
"errorCode": {
"mutateError": "RESOURCE_NOT_FOUND"
},
"message": "Resource was not found.",
"trigger": {
"int64Value": "-1"
},
"location": {
"fieldPathElements": [
{
"fieldName": "operations",
"index": 0
},
{
"fieldName": "create"
},
{
"fieldName": "asset_group"
}
]
}
},
{
"errorCode": {
"mutateError": "RESOURCE_NOT_FOUND"
},
"message": "Resource was not found.",
"trigger": {
"int64Value": "-1"
},
"location": {
"fieldPathElements": [
{
"fieldName": "operations",
"index": 1
},
{
"fieldName": "create"
},
{
"fieldName": "asset_group"
}
]
}
}
],
"requestId": "iQnDOIvLAySHvEyG9LLWPA"
}
]
}
}

curl --location 'https://googleads.googleapis.com/v17/customers/8702376846/assetGroups:mutate' \
--header 'Content-Type: application/json' \
--header 'developer-token: 0-4PjaUzBnyeiqsEkhbpgg' \
--header 'login-customer-id: 8663393180' \
--header 'Authorization: Bearer ya29.a0AcM612xKADH3bA8Db-er8Lk7wqYeF7QPkFu5SI1CH0wK0Nu2hMN41-cM6fM7mX_cv_emBzugBdv23lh0ZObrIHQnmzZ9wzjjK7gDWZwhh7LUjO40Pyq_sx5fc8M7XsK4Uqz9rZpBgsMqpIsNXj7xNFq1cwZ-XHGO3rjGcwIZ9QaCgYKAeQSARMSFQHGX2Mix_Ts_Ndx2xXMb9EahGR5IQ0177' \
--data '{
    "operations": [
        {
            "create": {
                "resourceName": "customers/8702376846/assetGroups/-1",
               
                "campaign": "customers/8702376846/campaigns/21572158461",
                "name": "pm-headline-asset-group",
                "finalUrls": [
                    "https://app-dev.adlaunch.io/"
                ],
                "finalMobileUrls": [
                    "https://your-mobile-landing-page.com"
                ],
                "status": "ENABLED",
                "adStrength": "PENDING"
            }
        }
    ]
}'
this is the curl i used for making asset group and the resource id i used here was temporary that i mentioned while making asset group assets ,but i am getting a following 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_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_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_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": {
"assetGroupError": "SHORT_DESCRIPTION_REQUIRED"
},
"message": "Short description asset for a valid asset group is required.",
"trigger": {
"stringValue": "Asset type: description"
},
"location": {
"fieldPathElements": [
{
"fieldName": "operations",
"index": 0
}
]
}
}
],
"requestId": "JCA0F6kUxccxMdBYKFGZ8A"
}
]
}
} kindly go through all these curls and let me know where am i making a mistake or missing something

Google Ads API Forum Advisor

unread,
Aug 20, 2024, 8:21:28 AM8/20/24
to dkno...@gmail.com, adwor...@googlegroups.com
Hi,

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

Based on the provided information, I understand that you are getting a "RESOURCE_NOT_FOUND" error from the API, this error means that the request refers to a resource that could not be found. The common cause of this error is that the request attempted to mutate or otherwise reference a resource that does not exist or has been removed. Or, the given resource name for the resource is malformed.

To handle this error, use a search request to retrieve the resource name for an existing resource before submitting a mutate request. Review our client library guides, which include documentation on how to construct valid resource names in every supported language. In order to prevent this error, kindly don't create resource names manually. Use one of the helper methods offered by our client libraries.

Also, I understand that you are getting an error "asset_group_error" while making the request to MutateAssetGroups. Kindly note that the AssetGroup within a Performance Max campaign necessitates an initial minimum assortment of assets. These assets may comprise pre-existing ones utilized in other campaigns or newly created assets tailored specifically for an AssetGroup within a Performance Max campaign. These errors might occur when asset requirements are not met. Kindly follow this guide to Ensure minimum asset requirements are met.

If you are still facing the issues even after following the given suggestions, please provide us the complete API logs (request and response with request-id and request header).

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.

You can send the details via Reply privately to the author option, or direct private reply to this email.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vF9hE:ref" (ADR-00263997)

Thanks,
 
Google Logo Google Ads API Team


 

Message has been deleted

Google Ads API Forum Advisor

unread,
Oct 14, 2024, 11:23:38 AM10/14/24
to 3pinte...@gmail.com, adwor...@googlegroups.com
Hi,

Please be informed that I have removed your response from the forums as it contains the PII information.

I understand that you are using the assetGroups method to create the asset groups for PMax campaigns using the Google Ads API. Performance Max campaigns are composed of multiple resources, and you have the option to create these separate resources in unique requests or in a single bulk mutate request. However, AssetGroups and associated AssetGroupAssets in standard Performance Max campaigns must be created in a single atomic request. Assets can be created individually and need to be attached with the asset IDs directly or you need to create the assets using the assetOperation. You need to make the bulk request using the 'googleAds.mutate' method in the Google Ads API. You can refer to the sample Java code for your requirement. Also, I would recommend you to refer to the 'Group operations with mutate requests' for more information. We have tried this approach and were successfully able to create the assetGroup. However, I have attached the sample request body for your requirement. 
Sample_format.txt
Reply all
Reply to author
Forward
0 new messages