I'm trying to implement the API following this example: Use Google Analytics API to show information in C#
I have followed all the instructions and in fact I'm successful in being authenticated. When I get the list of accounts, I actually see the correct account/profile and I see that I have ALL permissions.
var path = HostingEnvironment.MapPath("~/ServiceAccountProject-354a114cc3c1.p12");
var email = "myemail@developer.gserviceaccount.com";
GoogleConnector ga = new GoogleConnector(path,email );
var accounts = ga.Service.Management.Accounts.List().Execute();
However, when I execute the next line to get the analytics data for that exact account that I have full permissions for, I get the error "Google.Apis.Requests.RequestError User does not have sufficient permissions for this profile. [403] Errors [Message[User does not have sufficient permissions for this profile.] Location[ - ] Reason[insufficientPermissions] Domain[global]]"
var path = HostingEnvironment.MapPath("~/ServiceAccountProject-354a114cc3c1.p12");
var email = "myemail@developer.gserviceaccount.com";
GoogleConnector ga = new GoogleConnector(path,email );
var accounts = ga.Service.Management.Accounts.List().Execute();
var nuberOfPageViews = ga.GetAnalyticsData("ga:" + accounts.Items[0].Id, new string[] { "ga:pageviews" },
DateTime.Now.AddDays(-1), DateTime.Now).Rows[0][0];
Please help!