It seems the Google Ads API Client Library (PHP in my case) can automatically handle the access tokens by using a provided refresh token.

Does this mean that the client library will end up making additional calls in order to generate a new access token on every request?

If so, would it be better if I store the access token and pass it with each request and then track when it expires and handle generating a new one myself?

Tag:google-ads-api, oauth-2.0, google-api-php-client, google-oauth

2 comments.

  1. Dave Davis

    The client library (the Python one at least) does the latter by default. You might want to check if the PHP one does the same.

    1. MER

      Yes, the PHP client handles the access tokens by default. I'm just wondering if it would still be better for me to handle them myself. It seems by default, it will have to generate a new access token for every request. Whereas if I keep track of it and pass it in, it can reuse the same access token and not have to make that extra call.

Add a new comment.