1
votes

Hi generated secret file using OAuth 2.0 client ID. In that secret file, I do not see any google mail address to authenticate or access permissions to that mail address. Still facing below error.

Arg, there was an API error : 403 : User does not have sufficient permissions for this profile.

How come I know, to which user, we do not have sufficient previliges? Please help me with this

1
For the community to help you it will be helpful if you add relevant code. - rainer
@rainer actually in this instance the error message alone is enough to know what the problem is. But you are correct its best to always include the code in question. - DaImTo

1 Answers

0
votes

You have created an Oauth2 client for use with your application. When the application runs a user will need to login using their Google account and grant the application (client) access to their data. I have an article that explains how google oauth2 works if you are interested. Oauth2 for beginners

User does not have sufficient permissions for this profile.

Means that the user you have authenticated with does not have access to the Google Analytics profile you are trying to request data form. Try doing an Accountsummires.list this will return a list of the Google Analytics accounts that the current authenticated user has access to and the ones you will be able to request data from.

Question: How come I know, to which user, we do not have sufficient privileges?

You have a profile id you are trying to access find someone who has access to that profile and have them run your application. When they have logged in and authenticated they will be able to see the data.