TemporaryID for Label when adding AdGroupAd

69 views
Skip to first unread message

Viet Nguyen Huy

unread,
Jun 14, 2021, 10:26:52 PM6/14/21
to AdWords API and Google Ads API Forum
Hello,
I'm using GoogleAdsAPIs version 8, in the Batch Job Processing guide, as I understand, I can create a Label with temporary resource_name: customers/xxxxxxxxx/labels/-1 then set this resource_name to labels field of an AdGroupAd. This way, when run batchJob, I can create a new AdGroupAd and a new Label at the same time and also apply the new Label to the new AdGroupAd. I tried with this example, however, only the AdGroupAd is created, the label is not. The log said that I can not set the resource_name of Label in create operation. 

Mutate job #0 has a status 'Field 'resource_name' cannot be modified by 'CREATE' operation., at mutate_operations[0].label_operation.create.resource_name' and response of type 'N/A'.
Mutate job #1 has a status 'N/A' and response of type 'AD_GROUP_AD_RESULT'.

Is Label support the use of temporaryId? 

Thanks for your feedback and best regards,
Viet

Google Ads API Forum Advisor

unread,
Jun 16, 2021, 1:57:35 AM6/16/21
to vietn...@gmail.com, adwor...@googlegroups.com
Hi Viet,

Thank you for reaching out.

There are no entity restrictions specified in the Using temporary IDs guide. Also, label related operations are listed as supported in the BatchJobService's mutate operation which you can see here. That said, so our team can take a closer look at the issue, could you share the complete request and response logs, with the request-id?

If you haven't yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2IvjSp:ref

Viet Nguyen Huy

unread,
Jun 24, 2021, 3:18:30 AM6/24/21
to AdWords API and Google Ads API Forum
Hello Peter,

I am sorry for the late reply. I have sent the request privately. This is the response and request_id.

com.google.ads.googleads.v7.errors.GoogleAdsException: errors {
  error_code {
    request_error: IMMUTABLE_FIELD
  }
  message: "Field \'resource_name\' cannot be modified by \'CREATE\' operation."
  location {
    field_path_elements {
      field_name: "mutate_operations"
      index: 0
    }
    field_path_elements {
      field_name: "label_operation"
    }
    field_path_elements {
      field_name: "create"
    }
    field_path_elements {
      field_name: "resource_name"
    }
  }
}
request_id: "MZGPuDUqw7mXfDPOwbZUgg"

I could not set the resource_name when creating label. As the response indicates, resource_name of label is immutable, however, when I try with another resource campaign budget. I could set the resouce_name and create campaign budget normally even though refer to this document, resource_name of campaign budget is also immutable.
Reply all
Reply to author
Forward
0 new messages