Hello Bharani,
thank you for your feedback. So I fetched a list with all the accounts in
my main account an tried to get metrics for all of them. Unfortunately, I
get an error, if the requestet customer is a Manager.
def getListOfActiveAccounts(self, allAccounts, metric="Impressions", limit=0
):
__columns = ['Account ID', 'Account Name']
dfActiveAccounts = pd.DataFrame(columns=__columns)
for __accountID in allAccounts:
print(__accountID)
try:
query = ('SELECT customer.descriptive_name, customer.manager,
metrics.impressions, metrics.clicks FROM customer WHERE customer.manager =
False AND segments.date DURING LAST_30_DAYS')
__customerData = self.__customer_service.search(__accountID,
query=query, page_size=1000)
for row in __customerData:
print(row.customer.descriptive_name.value + " --
Impressions: " + str(row.metrics.impressions.value) + " -- Clicks:" + str
(row.metrics.clicks.value) + " -- Manager: " + str(row.customer.manager.
value))
except:
pass
So I tried to filter customer by customer.manager = False. But this seems
to be too late, as the request is already sent with metrics-request and
produces an error. For me, it is ok now, because I can fetch the error an
pass this customer. I just need Account that have metrics.
But maybee it is a nice additional feedback for your product-team. So
maybee it would be possible to filter manager-accounts in customer-resource
or in customer_client-resource.
Thanks
Michael
Am Dienstag, 9. April 2019 20:24:36 UTC+2 schrieb googleadsapi-forumadvisor:
Hello Michael,
Your approach is correct. The customer_client resource does not support any
metrics. You will need to use the customer to check if the impressions are
available. I have passed on the feedback you have shared with the team.
Please keep an eye on our blog for any future updates.
Thanks,
Bharani, Google Ads API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
https://ads-developers.googleblog.com/search/label/google_ads_api
https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/f5aac6a0-d254-428c-b872-f7b34e1fccd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.