I have an old project that is trying to extract data from Google Analytics.
It does not work, so I'm trying to figure out what is wrong.
Found a sample code for working with Analytics on the server side.
scope = ['https://www.googleapis.com/auth/analytics.readonly'] key_file_location = 'secrets.json' credentials = ServiceAccountCredentials.from_json_keyfile_name(key_file_location, scopes=scope) http = credentials.authorize(httplib2.Http()) service = build('analytics', 'v3', http=http) accounts = service.management().accounts().list().execute() print (accounts)
It works with a secrets file for my test account. But it does not work for the secrets file of the old project. I get the following error:
oauth2client.client.HttpAccessTokenRefreshError: invalid_client: The OAuth client was not found.
What is the problem? Is the secrets file out of date? If so, can I get another without access to google account?
python google-analytics-api
Snobby Jan 10 '17 at 11:47 on 2017-01-10 11:47
source share