Friday, October 15, 2021

Digest for adsense-api@googlegroups.com - 2 updates in 1 topic

Viharchandra Maheshkumar Popat <viharchandra@monetizemore.com>: Oct 14 02:59PM -0700

can you please help me with the below-mentioned code? it throws a type
error and I am not sure how to resolve it. I assume I am passing the wrong
start date and wrong date please help me with the right format to pass it
 
 
result = self.client.accounts().reports().generate(
account=f'accounts/{account id}',
startDate={"year": 2021, "month": 10, "day": 12},
endDate={"year": 2021, "month": 10, "day": 13},
metrics=report_job['METRIC'],
currencyCode='USD',
dimensions=report_job['DIMENSION'],
orderBy=['+DATE'],
).execute()
Ad Sense API <adsenseapi@forumsupport.google>: Oct 15 02:16AM

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.
 
Donovan McMurray
AdSense API Team
ref:_00D1U1174p._5004Q2PJneZ:ref
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to adsense-api+unsubscribe@googlegroups.com.

No comments:

Post a Comment