Search code examples
google-apiadsense-api

Google API: Customer is not an AdSense Host


What I'm trying to do?

List and create AdSense ad units using Google API.

What have I tried?

  1. Went to adunits.list on Google APIs Explorer.
  2. Inserted in my accountId and adClientId (pub-XXXXXXXXXXXXXX, ca-app-pub-XXXXXXXXXXXXXX)
  3. Clicked 'Execute'.
  4. I received error 403 "Customer is not an AdSense Host".
  5. Looked for online answers without much success, so here I am on StackOverflow.

Anyone knows how to do this?

Thanks!


Solution

  • As an AdSense publisher with regular AdSense account, you can't use AdSense for Host API.

    AdSense Host API is for host partner websites (Blogger, WebAnswers, DocStoc, etc.) and it enables site-owners to share revenue with their users.

    https://developers.google.com/adsense/host/featuresbenefits https://developers.google.com/adsense/host/become-a-host#eligibility

    You can use AdSense Management API adsense.accounts.adunits.list to retreive the list of your units. (But, you can't create new units with Management API.)

    https://developers.google.com/adsense/management/v1.4/reference/accounts/adunits/list