I tried to get data from Google Analytics API with Python client(google-api-python-client). Here\'s the code I used:
from apiclient import discovery
from oau
You are trying to access the Google Analytics API using a service account. A service account by default does not have access to any Google Analytics accounts.
What you need to do is take the Service account email address from the Google Developer console. Go to the Admin section of the Google Analytics Website. Give this service account access at the ACCOUNT level it must be the ACCOUNT level to the Google Analytics account you wish to access.
It wont work at the Web property or the view level it must be the Account level.