We are using Azure Data Factory to load GA4 data and Ads API data to data warehouse. To make the connection we have a Google Cloud project and use its credentials to authenticate.
I have setup ADF so that it will use a refresh token to get a new access token. The problem that im having is that refresh token expires in 7 days.
My understanding is that to expand the refresh token I need to publish the cloud project. I have done this in https://console.cloud.google.com/apis/credentials/consent . Under "Publishing status", I have clicked the "Publish app" button. Its currently showing "In production" and has a button labelled "Back to testing".
Sadly the refresh token still expires in 7 days. What am i missing or doing wrong? Is there some other place to publish the app?
At the moment i'm using developer playground to generate the refresh token. https://developers.google.com/oauthplayground/
Access token is generated trough https://www.googleapis.com/oauth2/v4/token API call.
Hi @Mefistofeles,
Welcome to the Google Cloud Community!
You are correct that once the Publishing status is in "In Production", tokens shouldn't expire after 7 days. Can you try doing the steps below from this Stack Overflow thread[1]:
- Go to https://console.cloud.google.com/apis/credentials/consent and change from the testing status to published.
- Delete the current token file.
- Authorize the API again by signing into your gmail account. You will be sent to a warning screen. From there, you can choose to proceed.
- When done you'll get a new token file
If the above option doesn't work, you can contact Google Cloud Support to further look into your case. Thank you! 😃
Hello, I also encountered this problem, very distressed, after Posting the status, refresh token really does not expire after seven days?
Hi @Mefistofeles here are some points to consider that might help you resolve this issue:
Steps to Resolve the Refresh Token Issue
Verify Google Cloud Project Configuration:
Use a Production Environment:
Check OAuth Client Type:
Documentation and Code Example:
If you are looking for an easier way to handle authentication and data transfer, you might consider using services that simplify this process. For instance, platforms like windsor.ai offer specific connectors for GA4 and facilitate data transfer to destinations like AzureSQL, automatically managing authentication and token renewal.
Using such solutions can help you avoid the challenges you are currently facing and ensure that data is transferred continuously and without interruptions, saving you time and effort in managing tokens and manual authentications.
Hope this helps!