Monday, November 30, 2015

Using AdSense API on Google Spreadsheets with Images

Posted by with No comments

This is a step-by-step tutorial to use AdSense with Google Spreadsheets. The example will show the daily earnings from 11/02/2015 to 11/20/2015

  1. Create a spreadsheet on Google Drive.
  2. Rename current page (sheet) to AdClients.
  3. Create a script Tools > Script Editor.
  4. Implement adClients() function.
  5. Enable Google Adsense Service from Resources > Advanced Google Services...
  6. Switch AdSense Management API to On state and click OK
  7. Click Run button
  8. Authorize for Adsense and Google Drive from the popups.


  9. Create a project on Google Developers Console if you haven't already.
  10. In Script Editor associate your created project with the script as following:
  11. Here you will enter the ProjectID in Google Developers Console


  12. Run the script
  13. In your spreadsheet you will see the ids for AdSense. Copy the ID which is starting with ca-pub-
  14. Clear your script editor (Thats all we should done with adClients() method) and implement generateReport() function. For adClientId variable paste your copied ID.
  15. Run the code. You will see the following result:

0 comments:

Post a Comment