How to get statistics for all accounts(active and inactive)?
At the moment I am getting stats this way:
$adWordsServices = new AdWordsServices(); $session = (new AdWordsSessionBuilder())->fromFile($this->account->token)->withOAuth2Credential($this->oAuth2Credential) ->build(); $managedCustomerService = $adWordsServices->get( $session, ManagedCustomerService::class ); // Create selector. $selector = new Selector(); $selector->setFields(['CustomerId', 'Name']); $selector->setOrdering([new OrderBy('CustomerId', SortOrder::ASCENDING)]); $selector->setPaging(new Paging(0, 100));
but how to get statistics for all accounts active and inactive? This code returns only list of active accounts.
It's unfortunately not possible to retrieve statistics for inactive / cancelled accounts.
You'll either receive a AuthorizationError.CUSTOMER_NOT_ENABLED error (in the Ads API) or a AuthorizationError.CUSTOMER_NOT_ACTIVE (in the Adwords API).