Cannot access Cancelled accounts

92 views
Skip to first unread message

Martin Manchev

unread,
Jun 24, 2022, 3:55:43 PM6/24/22
to Google Ads Scripts Forum
Hello,

with the new script experience we no longer have access to the Cancelled/Inactive Accounts when we try to run a script on MCC level.
I know it sounds a bit weird, but we still need to make some changes or pull some data from these accounts.

for example: 
var accountSelector = AdsManagerApp.accounts().withCondition("customer_client.descriptive_name = 'Active Account'").get(); - works fine

AdsManagerApp.accounts().withCondition("customer_client.descriptive_name = 'Cancelled Account'").get(); - returns an Error -  No more values


It would be great if that gets resolved soon or if you could provide me with some workaround.
Any help would be highly appreciated!






Google Ads Scripts Forum Advisor

unread,
Jun 27, 2022, 4:29:14 AM6/27/22
to adwords...@googlegroups.com

Hi Martin,

I’m James from the Google Ads scripts support team. Thank you for reaching out to us.

Can you please provide us with the following information below so that we can further investigate and troubleshoot?

  • Google Ads account ID / CID
  • Script name
  • Screenshot of the error

Kindly send the requested items via `Reply privately to author` option. If the said option is not available on your end, you may send those through this email alias <googleadsscr...@google.com> instead.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cCloQ:ref
Message has been deleted

Google Ads Scripts Forum Advisor

unread,
Jun 28, 2022, 2:55:26 AM6/28/22
to adwords...@googlegroups.com

Hi Martin,
 

Thank you for getting back to us. I work with James and allow me to assist you here.
 

Upon checking your implementation, your script is currently getting all accounts with name “'Cancelled Account”. Since you mentioned that you want to get an account with CANCELED status, you should add a condition .withCondition('customer_client.status = "CANCELED"') in your selector.


Please do note that this is a new behavior of the New Experience wherein the selector will only returns all your active accounts.


Regards,

Google Logo
Darwin
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cCloQ:ref

Martin Manchev

unread,
Jun 28, 2022, 4:29:45 AM6/28/22
to Google Ads Scripts Forum

Thank you for the help,


there isn’t any info about the customer_client.status in the Ads Scripts documentation. And I couldn't guess I have to use it.

I saw your testScript. It may be some kind of workaround, but yet I prefer the old scripts' behavior when we were able to access all accounts at once. 

Now we'll have to use 2 selectors - one for the active, and one for the canceled accounts.

ahmad Awa

unread,
Jun 28, 2022, 10:45:55 AM6/28/22
to Google Ads Scripts Forum on behalf of adsscripts
اخي ادخل حسابي وعالح المشكله

‫في الثلاثاء، 28 يونيو 2022 في 9:55 ص تمت كتابة ما يلي بواسطة ‪Google Ads Scripts Forum on behalf of adsscripts‬‏ <‪adwords...@googlegroups.com‬‏>:‬
--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/KkeAS000000000000000000000000000000000000000000000RE6DW800tVJy_j2bSiWlsnOkBjoMJw%40sfdc.net.

Google Ads Scripts Forum Advisor

unread,
Jun 28, 2022, 11:41:34 AM6/28/22
to adwords...@googlegroups.com
Hello,

As Ads scripts uses the Ads API for reporting functionality, it is worth using the Ads API reporting documentation to see what is supported for selectors and AdsApp Search/Report. Selector conditions are based on GAQL and Ads API attributes and metrics. 

There are new scripts experience features being added continuously. We appreciate your patience.

Thanks,

Google Logo
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cCloQ:ref

Martin Manchev

unread,
Sep 19, 2022, 4:43:07 AM9/19/22
to Google Ads Scripts Forum
Hello, 
I know it's an old thread, but can you please help me with the right syntax for the selector?
I want to access all the managed accounts that are currently ACIVE or CANCELLED.
I'm trying with:

var accountSelector = AdsManagerApp
  .accounts()
  .withCondition("customer_client.status IN ['CANCELED', 'ENABLED'']")

but It's not working.

Regards!

Martijn Kraan

unread,
Sep 19, 2022, 9:26:01 AM9/19/22
to Google Ads Scripts Forum
Hi Martin,

You're on the right track! It's just the Javascript syntax that's bothering you ;). Could you try this? --->

-------------------------------------------
function main() {
  const accountIterator = AdsManagerApp
     .accounts()
     .withCondition("customer_client.status IN (ENABLED, CANCELED)")
     .get();

  for (const account of accountIterator) {
    const accountName = account.getName();
    console.log(accountName);
  }
}
-------------------------------------------

You can find all the status values in the API documentation:
  • CANCELED
  • CLOSED
  • ENABLED
  • SUSPENDED
  • UNKNOWN
  • UNSPECIFIED

Good luck!

DeShun Brown

unread,
Sep 19, 2022, 7:35:02 PM9/19/22
to Google Ads Scripts Forum
Hi everyone I know this is a very old thread and (I dont know if this is even the right spot) But Idk how to get in contact with anyone else. I need your help, please. You all are far more advanced than me. So all I am trying to do is download a CSV file from my downloads folder into my google campaign  more advanced so hopefully this will be a simple one for you. I'm in the Campaign level I go to the three dots where it says more. I click upload from computer. I select CSV File I want to import. I Hit apply. And every time I get 100% fail rate 0 successful due to error message that reads "No header row found in this sheet"  but I do have a headers on my CVS sheets. I've tried uploading a google spreadsheet also with no luck. I've made sure that there is a header but this problem still continues. If anyone can help me or has any advise at all on how to get these files to upload It will be greatly appreciated. 

Screen Shot 2022-09-19 at 4.40.17 AM.png.     Screen Shot 2022-09-19 at 4.39.40 AM.png



Google Ads Scripts Forum Advisor

unread,
Sep 20, 2022, 12:46:34 AM9/20/22
to adwords...@googlegroups.com

Hi Martin,

 

This is Yasmin from the Google Ads scripts team.

 

You could check this link from our documentation on the ManagedAccountSelector for the format of a condition, which is .withCondition("ColumnName IN [Value1, Value2]").

 

That being said, if an error would still persist on your end, kindly provide more context as well as to it not working. It would also be highly appreciated if you can provide the following information (via `Reply privately to author` option or through the email alias `googleadsscr...@google.com` if the said option is not available on your end):

  • Complete screenshot of the issue
  • Google Ads ID / CID
  • Script name


Regards,

 

Google Logo
Yasmin Gabrielle
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cCloQ:ref

Martin Manchev

unread,
Sep 20, 2022, 2:39:07 AM9/20/22
to Google Ads Scripts Forum
It worked!
Thank you soooo much, Martijn!
I know I was making some small mistake, but I was stuck and couldn't find it. 

Martijn Kraan

unread,
Sep 20, 2022, 3:54:37 PM9/20/22
to Google Ads Scripts Forum
Your welcome and good luck optimizing your accounts!
Reply all
Reply to author
Forward
0 new messages