Associating sharedSet at the MCC level to campaigns in subaccounts

33 views
Skip to first unread message

Amine Achergui

unread,
Feb 26, 2024, 7:26:34 AM2/26/24
to Google Ads API and AdWords API Forum
Hi,

I'm trying to share a negative keyword set from my MCC account to campaigns in sub-accounts using the Google Ads API. This use case  is doable through the UI, but I'm getting an Exception using Java sdk v15. Here is my code :

List<String> resourceNames = new ArrayList<>();

CampaignSharedSet campaignSharedSet = CampaignSharedSet.newBuilder()
        .setCampaign(campaignResourceName)
        .setSharedSet(sharedSetResourceName)
        .build();

CampaignSharedSetOperation campaignSharedSetOperation = CampaignSharedSetOperation.newBuilder()
        .setCreate(campaignSharedSet)
        .build();

try (CampaignSharedSetServiceClient campaignCriterionServiceClient = googleAdsClient.getLatestVersion().createCampaignSharedSetServiceClient()) {
    MutateCampaignSharedSetsResponse response = campaignCriterionServiceClient.mutateCampaignSharedSets(
            customerId, ImmutableList.of(campaignSharedSetOperation));
    response.getResultsList().forEach(result -> resourceNames.add(result.getResourceName()));
}

and I am getting the following error:
Request
-------
MethodName: google.ads.googleads.v15.services.CampaignSharedSetService/MutateCampaignSharedSets
...
Failure message: errors {
  error_code {
    request_error: INVALID_CUSTOMER_ID
  }
  message: "Invalid customer ID 'XXXXXXXXX'."
}
...
Status: Status{code=INVALID_ARGUMENT, description=Request contains an invalid argument., cause=null}.
Where XXXXXXXXX is my MCC account.
What am I doing wrong? is That use case supported through the API ?

thank you,
Amine

Google Ads API Forum Advisor

unread,
Feb 26, 2024, 7:55:00 AM2/26/24
to amine.ache...@gmail.com, adwor...@googlegroups.com
Hi Amine,

Thank you for contacting the Google Ads API support team.

By reviewing your concern, I understand that you are encountering the "INVALID_CUSTOMER_ID". It means that the Customer ID is invalid. Kindly note that you have only provided the response and MethodName. Could you please confirm if you are trying to perform the create or remove operation on a campaign shared set? Also, could you confirm if you have followed the CampaignSharedSetOperation document?

In order to investigate the issue further, updated complete API logs (request and request-id with request header) generated at your end.

Since you are using a Java client library, I would request you to enable logging for the Java client library that you are using. You can refer to the guides Java 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.!5004Q02rzRN6:ref"

Thanks,
 
Google Logo Google Ads API Team


Reply all
Reply to author
Forward
0 new messages