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! On Tuesday 15 October 2024 at 13:48:16 UTC+2 Google Ads API Forum Advisor wrote: > Hi, > > Thank you for reaching out to the Google Ads API support team. > > Based on the information provided, I understand that you are trying to > programmatically add a shared exclusion list (shared set) at the account > level using the Google Ads API, but haven't found a direct method to do so > and are seeking guidance on how to achieve this through code. Can you > confirm the SharedSetType > <https://developers.google.com/google-ads/api/rest/reference/rest/v17/SharedSet#sharedsettype> > > that you are trying to create? I would recommend you to kindly refer to the > Create > And Attach Shared Keyword Set > <https://developers.google.com/google-ads/api/samples/create-and-attach-shared-keyword-set> > > guide as it explains clearly on how to create a shared set and attach it to > the campaign using the Google Ads API. We have tried this approach in > creating the shared set types as 'NEGATIVE_KEYWORDS' and were able to > succeed in attaching the shared set to the campaign. You can use the > customers.sharedSets > <https://developers.google.com/google-ads/api/rest/reference/rest/v17/customers.sharedSets/mutate?apix=true> > > method for creating the shared set and customers.campaignSharedSets > <https://developers.google.com/google-ads/api/rest/reference/rest/v17/customers.campaignSharedSets/mutate?apix=true> > > method for attaching the shared set to the campaign. However, I am > attaching the sample request and response logs for your reference. > > > 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. > > In order to investigate your issue further, kindly provide us with the > complete API logs (request > <https://developers.google.com/google-ads/api/docs/concepts/field-service#request> > > and response > <https://developers.google.com/google-ads/api/docs/concepts/field-service#response> > > logs with request-id > <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id> > > and request header > <https://developers.google.com/google-ads/api/docs/concepts/call-structure#request_headers>) > > generated at your end and uncropped UI screenshot of the Google Ads account > where you are facing the issue. > > 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 > <https://developers.google.com/google-ads/api/docs/client-libs/java/logging>, > .Net > <https://developers.google.com/google-ads/api/docs/client-libs/dotnet/logging>, > > PHP > <https://developers.google.com/google-ads/api/docs/client-libs/php/logging>, > Python > <https://developers.google.com/google-ads/api/docs/client-libs/python/logging>, > > Ruby > <https://developers.google.com/google-ads/api/docs/client-libs/ruby/logging> > or Perl > <https://developers.google.com/google-ads/api/docs/client-libs/perl/logging> > 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.!5004Q02vGePS:ref" (ADR-00271703) > > Thanks, > > [image: Google Logo] Google Ads API Team > > > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog: https://googleadsdeveloper.blogspot.com/ =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group. To post to this group, send email to adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/adwords-api/be2a8df3-2b38-4401-9b72-fb5e627aebafn%40googlegroups.com.