Unable to run Google Analytics sample code

86 views
Skip to first unread message

Wing Hang Khoo

unread,
Dec 3, 2021, 2:09:11 AM12/3/21
to Google Apps Script Community
I was following two guides from the Google App Script Reference


But I'm getting the error: GoogleJsonResponseException: API call to analytics.data.ga.get failed with error: User does not have sufficient permissions for this profile.

I have confirmed with my boss I am getting admin privileges. I have also checked on Google Analytics admin > property > property access management that I do have admin access.

I have two questions.
First one is, should I use the tracking ID or create a new property ID.
Second question is how am I able to get permission to run the codes.

I used tracking ID for the above codes, so UA-used_ID-1.

Thank you for the help.

Wing Hang Khoo

unread,
Dec 3, 2021, 2:09:15 AM12/3/21
to Google Apps Script Community
I was following two guides

and I am getting the error: GoogleJsonResponseException: API call to analytics.data.ga.get failed with error: User does not have sufficient permissions for this profile.

Not too sure if I should be using the tracking ID or create a new property ID. The above error I got was using tracking ID. I have confirmed I have admin privileges, so not too sure why I am getting this error.
Reply all
Reply to author
Forward
0 new messages