Hello,
I'm trying to get a report with all active extension withing active account.
Before I can even get to the AdWordsApp.report() method I get an error:
Ca: Could not read from Google Ads at main (Code:25:25) at
Object.<anonymous> (adsapp_compiled:20507:54)
function main() {
var activeIds = [];
var allAccountSelector = AdsManagerApp.accounts();
var accountIterator = allAccountSelector.get();
while (accountIterator.hasNext()) {
var accounts = accountIterator.next();
var hasImpressions = accounts.getStatsFor("LAST_30_DAYS");
if (hasImpressions.getImpressions() > 0) {
var accountId = accounts.getCustomerId();
activeIds.push([accountId]);
}
}
Logger.log(activeIds)
var customerIds = activeIds.map(ids => '"' + ids.join("-") + '"');
var accountSelector = AdsManagerApp.accounts().withIds(customerIds).get();
while(accountSelector.hasNext()){
var account = accountSelector.next();
MccApp.select(account);
}}
i don't get an error when I define accountSelector with the customerIds
variable...
the error is prompted when I start the while loop... why?
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/6d5eae23-c41e-4143-b960-5eb67d1a9b31n%40googlegroups.com.