Script not detecting account labels

190 views
Skip to first unread message

KGuiste1

unread,
Jul 13, 2022, 4:19:13 AM7/13/22
to Google Ads Scripts Forum
I have a MCC script that selects accounts by checking for a label.

The label exists and is attached to multiple accounts but the script does not detect this.

Can you help me figure out a solution to this?
Message has been deleted

KGuiste1

unread,
Jul 13, 2022, 4:54:33 AM7/13/22
to Google Ads Scripts Forum
var accSelector = {
  byLabel: 1,
  byAccId: 0
}

var ACCOUNT_LABEL = "Check Activity";

var DEBUG = 0;
var testNum = 0;

var test = AdsApp.getExecutionInfo().isPreview();

function main() {
  if (accSelector.byLabel){
    log("Trying Account Label Selector\n ");
    var accLabelSel = AdsManagerApp.accountLabels().withCondition("Name = '"+ACCOUNT_LABEL+"'").get();

    if(!accLabelSel.hasNext()){
      log("Creating Label: "+ACCOUNT_LABEL);
      AdsManagerApp.createAccountLabel(ACCOUNT_LABEL);
    } else {
      log("Label '"+ACCOUNT_LABEL+"' Exists: "+accLabelSel.hasNext());
    }
   
    while (accLabelSel.hasNext()){
      var accLab = accLabelSel.next();
      var accLabText = accLab.getName();
     
      var accIter = accLab.accounts().get();      
     
      log("Account are labelled with Account Label '"+accLabText+"': "+accIter.hasNext());
     
      while (accIter.hasNext()){
        var acc = accIter.next();
        var accName = acc.getName();        
        log("Account with Account Label: "+accName)
      }
    }
   
    log("\nTrying Account Selector\n ");
   
    var accSel = AdsManagerApp.accounts().withCondition("LabelNames = '"+ACCOUNT_LABEL+"'").get();
   
    log("Accounts Selected with '"+ACCOUNT_LABEL+"' Label: "+accSel.hasNext());
   
    while (accSel.hasNext()){
      var acc = accSel.next();
     
      var accName = acc.getName();
    }
  }
}

function log(x){
  Logger.log(x);
}

function debug(x){
  if(DEBUG){
    Logger.log(x)

KGuiste1

unread,
Jul 13, 2022, 4:59:37 AM7/13/22
to Google Ads Scripts Forum
After turning off 'New Ads Experience' I found that the account label selector can detect which accounts are labelled with that label,

However the account selector cannot select accounts by the account label.

Google Ads Scripts Forum Advisor

unread,
Jul 13, 2022, 11:04:43 PM7/13/22
to adwords...@googlegroups.com

Hello,

 

Michael here from Google Ads scripts Team. Thank you for reaching out to us.

 

For us to investigate further on the issue, kindly provide the below information:

  • Google Ads account ID / CID
  • Scriptname
  • Shareable link of the spreadsheet (if possible)
  • Screenshot of the issue

You may send the requested details privately via "Reply To Author" button.

Regards,

Google Logo
Michael Angelo
Google Ads Scripts Team
 



ref:_00D1U1174p._5004Q2cVYbl:ref

KGuiste1

unread,
Jul 14, 2022, 6:21:36 AM7/14/22
to Google Ads Scripts Forum on behalf of adsscripts
Account ID:  908-652-0123
Script Name: Label Retriever Tester

Shareable link of the spreadsheet (if possible): N/A
Screenshot of the issue: N/A

Script Output

New Scripts Experience OFF:

7/14/2022 11:18:48 AMTrying Account Label Selector
7/14/2022 11:18:49 AMLabel 'Check Activity' Exists: true
7/14/2022 11:18:50 AMAccount are labelled with Account Label 'Check Activity': true
7/14/2022 11:18:50 AMAccount with Account Label: Iberia - Acrobat Pro
7/14/2022 11:18:50 AMAccount with Account Label: BE - Acrobat Pro
7/14/2022 11:18:50 AMAccount with Account Label: DE - Acrobat Pro
7/14/2022 11:18:50 AMAccount with Account Label: FR - Acrobat Pro
7/14/2022 11:18:50 AMAccount with Account Label: Nordics - Acrobat Pro
7/14/2022 11:18:50 AMAccount with Account Label: IT - Acrobat Pro
7/14/2022 11:18:50 AMAccount with Account Label: UK - Acrobat Pro
7/14/2022 11:18:51 AMAccount with Account Label: ZA - Acrobat Pro
7/14/2022 11:18:51 AMAccount with Account Label: UK - EchoSign
7/14/2022 11:18:51 AMAccount with Account Label: TR - Acrobat Pro
7/14/2022 11:18:51 AMAccount with Account Label: PL - Acrobat Pro
7/14/2022 11:18:52 AMAccount with Account Label: FR - Adobe Sign
7/14/2022 11:18:52 AMAccount with Account Label: DE - Adobe Sign
7/14/2022 11:18:52 AMAccount with Account Label: Nordics - Adobe Sign
7/14/2022 11:18:52 AMAccount with Account Label: AT & CH - Acrobat Pro
7/14/2022 11:18:52 AMAccount with Account Label: EMEA Tier 2 - Adobe Sign
7/14/2022 11:18:52 AMAccount with Account Label: EMEA Tier 3 - Adobe Sign
7/14/2022 11:18:52 AM Trying Account Selector
7/14/2022 11:18:53 AMAccounts Selected with 'Check Activity' Label: false

New Scripts Experience ON:

7/14/2022 11:20:19 AMTrying Account Label Selector
7/14/2022 11:20:20 AMLabel 'Check Activity' Exists: true
7/14/2022 11:20:21 AMAccount are labelled with Account Label 'Check Activity': false
7/14/2022 11:20:21 AM Trying Account Selector
7/14/2022 11:20:22 AMAccounts Selected with 'Check Activity' Label: false

Regards
Kurvin


--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/fEmUhsmsY0A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/ONm7i000000000000000000000000000000000000000000000REZPVP00CI71oOgKQDGbJuOPrlMllg%40sfdc.net.

Google Ads Scripts Forum Advisor

unread,
Jul 15, 2022, 1:26:04 AM7/15/22
to adwords...@googlegroups.com

Hello Kurvin,

 

Maia here, I work along with Michael.

 

Upon testing your script on our end in the New Script Experience, it appears that it seems to be working fine. Would you be able to retry the script on your end in the New Scripts Experience? Additionally, kindly share with us a screenshot or file that showcases the comparison/difference between running in the New Experience and in Legacy (toggling off the New Experience).

 

Best Regards,

Google Logo
Angel Maia
Google Ads Scripts Team
 

 

ref:_00D1U1174p._5004Q2cVYbl:ref

KGuiste1

unread,
Jul 15, 2022, 4:55:11 AM7/15/22
to Google Ads Scripts Forum on behalf of adsscripts
Hi Maia,

I forgot to mention but I did test the script outside of the Adobe Google Ads Account and it did work as intended.

I suspect that the issue is related to the specific account environment.

I already shared with you the results of toggling the New Scripts Experience in my previous email:



Script Output

New Scripts Experience OFF:

7/15/2022 9:52:05 AM Trying Account Label Selector
 
7/15/2022 9:52:06 AM Label 'Check Activity' Exists: true
7/15/2022 9:52:06 AM Account are labelled with Account Label 'Check Activity': true
7/15/2022 9:52:06 AM Account with Account Label: Iberia - Acrobat Pro
7/15/2022 9:52:06 AM Account with Account Label: BE - Acrobat Pro
7/15/2022 9:52:06 AM Account with Account Label: DE - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: FR - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: Nordics - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: IT - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: UK - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: ZA - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: UK - EchoSign
7/15/2022 9:52:07 AM Account with Account Label: TR - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: PL - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: FR - Adobe Sign
7/15/2022 9:52:07 AM Account with Account Label: DE - Adobe Sign
7/15/2022 9:52:07 AM Account with Account Label: Nordics - Adobe Sign
7/15/2022 9:52:07 AM Account with Account Label: AT & CH - Acrobat Pro
7/15/2022 9:52:07 AM Account with Account Label: EMEA Tier 2 - Adobe Sign
7/15/2022 9:52:07 AM Account with Account Label: EMEA Tier 3 - Adobe Sign

7/15/2022 9:52:07 AM Trying Account Selector
 
7/15/2022 9:52:08 AM Accounts Selected with 'Check Activity' Label: false

New Scripts Experience ON:

7/15/2022 9:54:26 AM Trying Account Label Selector
 
7/15/2022 9:54:28 AM Label 'Check Activity' Exists: true
7/15/2022 9:54:28 AM Account are labelled with Account Label 'Check Activity': false
7/15/2022 9:54:28 AM
Trying Account Selector
 
7/15/2022 9:54:30 AM Accounts Selected with 'Check Activity' Label: false

Nothing has changed

Regards
Kurvin


--
-- 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 a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/fEmUhsmsY0A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.

Google Ads Scripts Forum Advisor

unread,
Jul 18, 2022, 5:40:05 AM7/18/22
to adwords...@googlegroups.com
Hi Kurvin,

Thank you for getting back to us. We've receive the same reported behavior as this one which is currently under investigation. I've added your information to the team. I'll update you the soonest their share their findings.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 
 

ref:_00D1U1174p._5004Q2cVYbl:ref

KGuiste1

unread,
Oct 27, 2022, 6:53:10 AM10/27/22
to Google Ads Scripts Forum
Hi,

Has there been any update on this?

Regards

Google Ads Scripts Forum Advisor

unread,
Oct 28, 2022, 1:59:59 AM10/28/22
to adwords...@googlegroups.com

Hello,

I’m James from the Google Ads scripts support team as well. I’m afraid that there are no updates yet regarding your issues as our internal team is continuously investigating this. I understand this issue has been taking some time to resolve, but I assure you that our team is doing everything in our abilities to resolve pending issues on our end. That said, we greatly appreciate your continued patience on this. Rest assured that we will get back to you once we have an update.

Regards,

Google Logo
James Howell
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2cVYbl:ref

Google Ads Scripts Forum Advisor

unread,
May 9, 2023, 4:24:24 AM5/9/23
to adwords...@googlegroups.com

Hi All,

 

Just circling back to this thread, I'd like to inform you that this issue is still under investigation. We'll get back soon as we receive relevant information from our wider team.

 

Best regards,

 

Google Logo Google Ads Scripts Team


ref:_00D1U1174p._5004Q2cVYbl:ref

Google Ads Scripts Forum Advisor

unread,
May 9, 2023, 10:22:41 AM5/9/23
to adwords...@googlegroups.com

Hi All,

 

Thank you for your patience. Could you please confirm if this issue is still persisting on your end?

 

If yes, could you please provide a recent execution which shows this issue so our team can further investigate? Please do scrub any private information when posting information/images here. You may send them privately via the Reply to author option or send it through our email (googleadsscr...@google.com) instead.

Reply all
Reply to author
Forward
0 new messages