Exclude audience from ad group error

37 views
Skip to first unread message

Quang Quy

unread,
Jul 26, 2022, 10:55:39 AM7/26/22
to Google Ads Scripts Forum
Hi Team !
I want to remove the audience from the ad group but get an error. I don't know how to fix it, can someone tell me where the error is.
Here is my code:
const operation = adGroup
            .videoTargeting()
            .newAudienceBuilder()
            .withAudienceId(audience.audience_id)
            .withAudienceType(audience.adGroupCriterion.type)
            .exclude();

          if (!operation.isSuccessful()) {
            console.warn(
              `Failed to exclude audience ${audience.adGroupCriterion.displayName} from ad                   group ${audience.adGroup.name}. ` +
                `Errors: ${operation.getErrors().join(', ')}'`
            );
          }
screenshot_1658833333.png
This is the error I get:
Errors: The field attempted to be mutated is immutable. ({"errorCode":{"fieldError":"IMMUTABLE_FIELD"},"message":"The field attempted to be mutated is immutable.","location":{"fieldPathElements":[{"fieldName":"mutate_operations" ,"index":0},{"fieldName":"ad_group_criterion_operation"},{"fieldName":"create"},{"fieldName":"negative"}]}})

Google Ads Scripts Forum Advisor

unread,
Jul 27, 2022, 2:27:44 AM7/27/22
to adwords...@googlegroups.com

Hi Quang,

 

Thank you for reaching out to us. This is Yasmin from the Google Ads Scripts team.

 

I can see that you've created a new thread with the same concern mentioned on this thread. Please refrain from opening multiple forum threads with the same content for better tracking of the issue. That being said, let's continue our conversation over at the aforementioned thread I've referenced.

 

Regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2d1bzE:ref
Reply all
Reply to author
Forward
0 new messages