In Google Ads API, the “long-lived token” you want is the OAuth2 refresh token. It doesn’t have a fixed expiry (it lives until revoked or unused for a long time). Here’s the fastest, reliable way to get one and use it in Laravel.
OAuth Playground (fastest)
- Go to the OAuth Playground
- Click the gear (⚙️) → Use your own OAuth credentials → paste your Client ID and Client Secret.
- In Step 1, select the scope: https://www.googleapis.com/auth/adwords
- Click Authorize APIs and sign in with the Google account that owns your Google Ads (or MCC).
- Click Exchange authorization code for tokens.
- Copy the Refresh token shown. That’s your long-lived token.
- Save it in your
adsapi_php.ini
or.env
and you’re done.
If you don’t see a refresh token, you probably missed these parameters. Make sure the auth request includes:
access_type=offline
prompt=consent
If you git rejected by Google, make sure that redirect url is correctly set.
Go to: https://console.developers.google.com/auth/clients
and make sure "Aithorized redirect URIs" contains this uri:
https://developers.google.com/oauthplayground
And that is it!