Ads API: New Customer auto_tagging_enabled IMMUTABLE_FIELD, no validateOnly option also?

48 views
Skip to first unread message

Joel

unread,
May 10, 2019, 4:15:30 PM5/10/19
to AdWords API and Google Ads API Forum
I am trying to create a new Account and set autoTaggingEnabled. When I perform the operation I get back a message that this field is immutable - so how can I set this? Also, testing this is very cumbersome because there's no validateOnly option, so every successful call actually makes a new Account. Is there a way to do this with validation only?
Thanks!

Joel

// Build a new Customer object and populate required objects
Customer.Builder builder = Customer.newBuilder()
.setDescriptiveName(StringValue.of(spec.name))
.setCurrencyCode(StringValue.of(spec.currencyCode))
.setTimeZone(StringValue.of(spec.timeZone))
.setTestAccount(BoolValue.of(spec.testAccount));
//.setAutoTaggingEnabled(BoolValue.of(true)); // IMMUTABLE_FIELD message: "Field \'auto_tagging_enabled\' cannot be modified by \'CreateCustomerClient\' operation."

// Sends the request to create the customer.
try (CustomerServiceClient client = googleAdsClient.getLatestVersion().createCustomerServiceClient())
{
// Does not have a validateOnly option
CreateCustomerClientResponse response = client.createCustomerClient(spec.managerId, builder.build());
}

googleadsapi...@google.com

unread,
May 13, 2019, 11:41:47 AM5/13/19
to AdWords API and Google Ads API Forum
Hello Joel, 

The error indicates that you cannot set the auto-tagging while creating the account. You will first need to create an account and then perform the mutate operation to set the auto-tagging. Please find the code snippet below as a reference: 

CustomerServiceClient customerServiceClient = googleAdsClient.getLatestVersion().createCustomerServiceClient();
Customer customer = Customer.newBuilder()
.setResourceName(ResourceNames.customer(6664466450L))
.setAutoTaggingEnabled(BoolValue.of(true))
.build();
CustomerOperation operation = CustomerOperation.newBuilder()
.setUpdate(customer)
.setUpdateMask(FieldMasks.allSetFieldsOf(customer))
.build();

MutateCustomerResponse response =
customerServiceClient.mutateCustomer("6664466450", operation); 

The CID should be of the newly created account that you're mutating. Could you please give this a try?

Thanks,
Bharani, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Reply all
Reply to author
Forward
0 new messages