The official blog for information about the Google Ads, Google Ad Manager, Google Mobile Ads SDKs for AdMob and IMA SDKs, and other Google Advertising Platform developer tools.
But here is the really useful part: there is a handy feature that you can use to calculate relative dates by adding or subtracting days, weeks, months, or years:
Start date
End date
Last 7 days’ performance
today-6d
today
Last month’s performance
startOfMonth-1m
startOfMonth-1d
Previous six months
startOfMonth-6m
startOfMonth-1d
You can use up to two operations per date. Let’s say we need to compare last month with the same period last year. We would need two requests like these two requests with these start and end dates:
Start date
End date
Last month’s performance
startOfMonth-1m
startOfMonth-1d
Same month last year
startOfMonth-1m-1y
startOfMonth-1d-1y
If you want to try these out, we recommend using the APIs explorer. You’ll find it at the bottom of each method documentation page:
If you have any questions about this post or the AdSense APIs in general, visit the AdSense API Forum. You can also follow our Google Ads Developers G+ page for ad-related updates.
PHP Make sure you get the latest files from the trunk of the repository. You may only need to replace trunk/src/contrib/Google_AdSenseService.php but you should update all the files you use.
Python Good news for you! No need to download any libraries, the discovery service knows what to do. Create the service as follows: http = httplib2.Http() service = build("adsense", "v1.2", http=http)
To make sure you’re using the latest version, list your saved ad styles. It’s a new feature only available to v1.2, so if you don’t get an error, you’re on the right track.
To learn about the AdSense Management API read the docs and post your questions on the AdSense API Forum and we’ll do our best to help you! Also, follow our Google Ads Developers G+ page to receive important announcements and tips.