Tuesday, August 22, 2023

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

Adrien Hingert <ahingert@gmail.com>: Aug 20 03:15AM -0700

Hi, I'm trying to write a PHP script which will allow a server to pull
AdSense data when it's run. I managed to get this working via Google Sheets
& App Script, but I'm having trouble even understanding how to authenticate
when doing so via PHP.
 
Could somebody point me to a step-by-step process which will allow me to
authenticate my server-side script and pull a basic dataset from AdSense?
 
Some questions I have:
- What credentials do I need? (API Keys, OAuth 2.0 Client IDs, Service
Accounts...)
- Where do I get these? (here
<https://console.cloud.google.com/apis/credentials>?)
- Any specific configuration I need?
- Can you show me the barebones PHP code which will take these credentials
and authenticate the script?
 
I'm sure I'm not the first person to run into this type of problem, but for
the life of me, I can't find a clear explanation of what I'm doing wrong.
Ad Sense API <adsenseapi@forumsupport.google>: Aug 21 09:08AM

Hi Adrien,
 
Thanks for your email. I'd recommend starting with the documentation at https://developers.google.com/adsense/management/getting_started. That includes pages discussion OAuth (https://developers.google.com/adsense/management/direct_requests#OAuth2Authorizing), and links to PHP sample code (https://developers.google.com/adsense/management/libraries).
 
I hope that helps,
Andrew (AdSense API team)
ref:_00D1U1174p._5004Q2o6wEK: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.

3 comments: