Hi,
I'm trying to add a shared exclusion list (shared set) at the account level programmatically using the Google Ads API, but I haven't found a direct way to do this. Could you please provide guidance on how to add a shared set at the account level from code?
Additionally, I have a shared set created at the MCC (root account) level, and when I try to apply it to a campaign, I get the following error both through the UI and the API:
Error from the UI: EntityNotFound.INVALID_ID – "SharedSet not found or not allowed to be attached to a campaign"
Error from the API: "Resource not found" or similar error.
I've tried both scenarios:
In both cases, I encounter errors when trying to add the shared set to a campaign.
Questions:
Any help or clarification on the correct process for handling shared sets at the account and campaign levels via the API would be appreciated!
Shared set Creation: ===================== Request Body: ============ POST https://googleads.googleapis.com/v17/customers/{customerId}/sharedSets:mutate?key=[YOUR_API_KEY] HTTP/1.1 developer-token: ********************** Authorization: Bearer [YOUR_ACCESS_TOKEN] Accept: application/json Content-Type: application/json { "operations": [ { "create": { "name": "shared set in client account", "type": "NEGATIVE_KEYWORDS" } } ] } Response: ========== HTTP/1.1 200 cache-control: private content-encoding: gzip content-length: 109 content-type: application/json; charset=UTF-8 date: Tue, 15 Oct 2024 08:22:32 GMT server: ESF vary: Origin, X-Origin, Referer { "results": [ { "resourceName": "customers/{customerId}/sharedSets/{shared_set_id}" } ] } Attaching the shared set to the campaign: =================================== Request Body: ============= POST https://googleads.googleapis.com/v17/customers/{customerId}/campaignSharedSets:mutate?key=[YOUR_API_KEY] HTTP/1.1 developer-token: ********************** Authorization: Bearer [YOUR_ACCESS_TOKEN] Accept: application/json Content-Type: application/json { "operations": [ { "create": { "campaign": "customers/{customerId}/campaigns/{campaignId}", "sharedSet": "customers/{customerId}/sharedSets/{shared_set_id}" } } ] } Response: ========= HTTP/1.1 200 cache-control: private content-encoding: gzip content-length: 129 content-type: application/json; charset=UTF-8 date: Tue, 15 Oct 2024 08:38:45 GMT server: ESF vary: Origin, X-Origin, Referer { "results": [ { "resourceName": "customers/{customerId}/campaignSharedSets/{campaignId}~{shared_set_id}" } ] }Similarly, we created a shared set at the MCC level using the Google Ads API and attempted to link it to a campaign, but encountered a RESOURCE_NOT_FOUND error. We later understood that since campaigns cannot be created at the MCC account level, the shared set cannot be attached to client-level campaigns. However, we were able to apply the MCC level shared sets 'NEGATIVE_KEYWORDS' to the client level campaigns without any issues from the Google Ads UI.
![]() |
Google Ads API Team |
Hi,
We currently have a Placement Exclusion List created at the Root account level through the UI. Our goal is to attach this shared set to a regular account (sub-account) under an MCC account, either at the account or campaign level via code. When attempting to add it at the campaign level, we receive a "resource not found" error from the code. Additionally, we haven’t found any examples in .NET for attaching the shared set at the account level.
In the Google Ads UI, we can share the shared set with sub-accounts directly through the sub-account settings. However, we are unsure how to replicate this programmatically using the Google Ads API. Could you provide guidance or examples for adding a shared set at the account level, similar to the UI process?
Thank you for your assistance!