RE: Passing start date & end date Adsense API v2

88 views
Skip to first unread message
Message has been deleted

Ad Sense API

unread,
Oct 14, 2021, 10:16:56 PM10/14/21
to adsen...@googlegroups.com
Hi,

It looks like you're using our Python client library, so the code should look like the code below. You can see the full example here.

        result = service.accounts().reports().generate(
            account=account_id, dateRange='CUSTOM',
            startDate_year=2021, startDate_month=3, startDate_day=1,
            endDate_year=2021, endDate_month=3, endDate_day=31,
            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()


Let me know if you have any other questions.

Google Logo
Donovan McMurray
AdSense API Team
 


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