Get adSense Report data (V2) problems using Python code

279 views
Skip to first unread message

Kai Wang

unread,
Oct 18, 2021, 5:18:10 AM10/18/21
to AdSense API Forum
Hi, Aadsense team.I used the reference code(https://github.com/googleads/googleads-adsense-examples/blob/master/v2/python/generate_report.py) from the official website to get adSense data.After authorized login, the API returns empty results.
Here is the code I used:
result = service.accounts().reports().generate(
account=account_id, dateRange='CUSTOM',
startDate_year=2021, startDate_month=9, startDate_day=1,
endDate_year=2021, endDate_month=9, endDate_day=15,
metrics=['PAGE_VIEWS', 'AD_REQUESTS', 'AD_REQUESTS_COVERAGE',
'CLICKS', 'AD_REQUESTS_CTR', 'COST_PER_CLICK',
'AD_REQUESTS_RPM', 'ESTIMATED_EARNINGS'],
dimensions=['MONTH', 'PLATFORM_TYPE_NAME'],
orderBy=['+MONTH']).execute()ppc1.jpgppc2.jpg

Ad Sense API

unread,
Oct 18, 2021, 5:34:52 AM10/18/21
to adsen...@googlegroups.com
Hi,

Are you trying to fetch AdMob data? Per the v2 Release Notes, AdMob data will no longer be returned by the AdSense Management API. For that, you will need to migrate to the AdMob API.

If it isn't the case that you're fetching AdMob data, could you provide me with a little more information to investigate? You can write a private email to "adsenseapi-tech [at] google [dot] com" with your publisher id.

Google Logo
Donovan McMurray
AdSense API Team
 


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