Script to see which accounts in MCC do not have auto-tagging enabled

218 views
Skip to first unread message

lea.h...@commissionsinc.com

unread,
Jun 6, 2022, 1:58:46 PM6/6/22
to Google Ads Scripts Forum
Hello,

In our MCC, we want to switch any accounts that don't yet have the Auto-tagging (Tag the URL that people click through my ad) setting enabled over to have Auto-tagging enabled.

In the Google Ads UI, this is under Account Settings (including a screenshot).

Is it possible to either run a script that reports the auto-tagging status of our accounts, or would enable auto-tagging for the accounts that are currently not using that setting? 

Thanks for your help!
auto tagging option under Account settings.png

Google Ads Scripts Forum Advisor

unread,
Jun 6, 2022, 2:39:34 PM6/6/22
to adwords...@googlegroups.com
Hello,

Thanks for reaching out. You can iterate over accounts from a manager, and check each accounts auto-tagging status using the customer report's auto_tagging_enabled attribute. Please see these sample reporting sample scripts for reference.

Regards,

Google Logo
Matt
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q2bcimk:ref

lea.h...@commissionsinc.com

unread,
Jun 8, 2022, 1:40:15 PM6/8/22
to Google Ads Scripts Forum
Thank you, Matt! This is what I'm currently using, and I'm going to try to revise it export it to a spreadsheet rather than relying on the logs.  We have a large MCC and the script isn't getting through all the accounts before timing out. Do you see anything inefficient in the script? I was wondering if I added a time zone filter to the select clause if that possibly help the processing time?   for example:  'SELECT customer.id, customer.descriptive_name, customer.auto_tagging_enabled FROM customer WHERE customer.auto_tagging_enabled = FALSE AND customer.time_zone LIKE "America/New_York" AND customer.status = "ENABLED"');    and run it once for every time zone. 

and would using AdsApp.report instead of AdsApp.search possibly speed it up?



function main() {
 
  var managerAccount = AdsApp.currentAccount();
 
 var accountIterator = accountSelector.get();
 while (accountIterator.hasNext()) {
   var account = accountIterator.next();
 
    AdsManagerApp.select(account);
   
    const myreport = AdsApp.search(
   'SELECT customer.id, customer.descriptive_name, customer.auto_tagging_enabled FROM customer WHERE customer.auto_tagging_enabled = FALSE');

      for (const row of myreport) {
    const CID = row.customer.id;
    const clientname = row.customer.descriptiveName;
    const AutoTagging = row.customer.autoTaggingEnabled;
       // const status = row.customer.status;
    console.log(`${CID}, ${clientname}, ${AutoTagging},`);
  }
}
}

Google Ads Scripts Forum Advisor

unread,
Jun 9, 2022, 1:22:50 AM6/9/22
to adwords...@googlegroups.com
Hello,

I work along with Matt. Thank you for getting back to us.

With regard to your concern, please do note that AdsApp.report and AdsApp.search method have the same performance. They both accept the same kinds of queries, and differ primarily in how they return the results. More information can be found here.

As per your script is timing out, I'm afraid the there's no way to bypass the script execution limit of 30 minutes. What we can suggest is to create a multiple copy of the script instead, then create a filter on each copy (for your use case, per time zone), so that the script operates on only a subset of your entity based on your filter.

Regards,
Google Logo
Teejay Wennie
Google Ads Scripts Team
 

 

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