dima_anoshin
07/21/2023, 4:50 AMdima_anoshin
07/21/2023, 4:50 AMmindaugas_nizauskas
07/21/2023, 5:41 AMdima_anoshin
07/21/2023, 6:11 AMdima_anoshin
07/21/2023, 6:12 AMmeltano elt tap-google-analytics target-jsonl
and it works still, I will try the one you shared, thank you!dima_anoshin
07/21/2023, 6:15 AMoauth_credentials.access_token
oauth_credentials.client_id
oauth_credentials.client_secret
oauth_credentials.refresh_token
I've got the client_id
and client_secret
and then I use strange url to get refresh token
<https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id=$CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.readonly&access_type=offline&prompt=consent>
After I use strange python:
import requests
def exchange_code_for_tokens(client_id, client_secret, code):
url = "<https://oauth2.googleapis.com/token>"
data = {
'code': code,
'client_id': client_id,
'client_secret': client_secret,
'redirect_uri': '<http://localhost>',
'grant_type': 'authorization_code',
}
response = <http://requests.post|requests.post>(url, data=data)
return response.json()
client_id = "YOUR_CLIENT_ID"
client_secret = "YOUR_CLIENT_SECRET"
code = ""
tokens = exchange_code_for_tokens(client_id, client_secret, code)
print(tokens)
to get the access_token
and this was enougth to export data from GA.
However, the token will expire in 3000s, how meltano can obtain fresh token to run tap daily?dima_anoshin
07/21/2023, 6:30 AMNote: If the Property Settings shows a "Tracking Id" such as "UA-123...-1", this Property is a Universal Analytics property, and the Analytics data for that property cannot be reported on in the Data API. For that property, you can use the Google Analytics Reporting API v4 to produce analytics data reports.
And I have the UA-... Tracking IDpat_nadolny
07/21/2023, 1:19 PM