Hi Anshul,
Thanks for reaching out. I am Harry from the Google Ads Script Team. Allow me to assist you on this.
To retrieve entities at the
AdGroup level, kindly use a
AdGroupSelector and
AdGroupIterator. Here's an
example on how to get all of your Ad Groups, but since you would like to retrieve paused Ad Groups, you would have to add a
withCondition to your Ad Group selector to only retrieve Ad Groups that are paused (Eg withCondition("Status = PAUSED") ). After that, you may remove Ad Group Tracking Templates by using the
clearTrackingTemplate() method.
In addition, since you have mentioned that you would have to manage a large number of Ad Groups, I would suggest to keep your entities in a list first rather than managing them in your iterator directly as this may cause unexpected behaviors due to the large number of entities you would like to manage. When you update a list of entities, make sure your code doesn't break the iterator's selector condition as a side effect. This leaves the selector in an indeterminate state and may cause unexpected behavior. Please see the recommended
coding approach.
Let me know if you have questions or other concerns.
Thanks,
 |
| Harry Cliford Rivera |
| Google Ads Scripts Team |
|
|
| |

ref:_00D1U1174p._5004Q2EpbdT:ref