我收到了Google Analytics小组关于项目白名单的确认电子邮件,并尝试插入目标但收到了错误。
{The service analytics has thrown an exception: Google.GoogleApiException: Google.Apis.Requests.RequestError
Your project does not have access to this feature. [403]
Errors [
Message[Your project does not have access to this feature.] Location[ - ] Reason[insufficientPermissions] Domain[global]
]
at Google.Apis.Requests.ClientServiceRequest`1.<ParseResponse>d__34.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Google.Apis.Requests.ClientServiceRequest`1.Execute()}
我正在使用Google.Apis.Analytics.v3(1.32)nuget包来创建目标
我写的代码是:
var goal = new Goal();
goal.AccountId = accId;
goal.WebPropertyId = websiteId;
goal.ProfileId = profileId;
goal.Name = "Api Funnel";
goal.Active = true;
goal.Created = new DateTime();
goal.Type = "URL_DESTINATION";
var urlDestinationDetails = new UrlDestinationDetailsData();
urlDestinationDetails.MatchType = "EXACT";
var stepData0 = new UrlDestinationDetailsData.StepsData();
stepData0.Number = 0;
stepData0.Url = "step1";
stepData0.Name = "Step1";
var stepData1 = new UrlDestinationDetailsData.StepsData();
stepData1.Number = 0;
stepData1.Url = "step2";
stepData1.Name = "Step2";
var steps = new List<UrlDestinationDetailsData.StepsData>();
urlDestinationDetails.Steps = steps;
goal.UrlDestinationDetails = urlDestinationDetails;
goal.UrlDestinationDetails.Url = "step2";
var request = analyticsService.Management.Goals.Insert(goal, accId, websiteId, profileId);
request.Execute();
范围设置为analytics.edit:
仍然,我正面临着这个问题
google analytics management api - Insert goals - 403
也提到相应的帖子,但无法找到答案。
成功处理了所有get请求,返回正确的数据。 现在,我想插入一个目标但是遇到了这个问题。
还要求使用谷歌的问题跟踪器
https://issuetracker.google.com/issues/71837169
此外,开发者论坛小组现已关闭:https://groups.google.com/forum/?fromgroups#!forum/google-analytics-management-api
请随时询问任何其他信息。
答案 0 :(得分:0)
Web Property,View(Profile)和Goal资源的Management API中的编写操作(例如,创建,更新,删除,修补)目前在限量版中作为开发人员预览版提供。如果您对使用这些功能感兴趣,请申请访问测试版。
Google Analytics写作操作处于测试阶段。你说你申请并被列入白名单。您必须使用您申请的Google Developer Project才能访问它。
您的项目无法访问此功能。
表示您用于进行身份验证的客户端ID和秘密无法访问此功能,而不是您申请访问的项目的一部分,而该项目是白名单。