本文介绍了GA管理API-自定义维度list()-错误403:权限不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Management API(使用PY客户端库)来获取自定义维度"列表,如此处所述-自定义维度:列表

I'm using Management API (using PY Client Library) to get list of Custom Dimensions as described here - Custom Dimensions: list

link = analytics.management().customDimensions().list(accountId = ACCOUNT_ID,
                                                     webPropertyId = PROPERTY_ID)
dimensions = link.execute()

,但API不断返回Error Code: 403, Insufficient Permission

我非常确定我用来构建凭据对象的服务帐户电子邮件地址具有足够的编辑,阅读和阅读"信息.在Google Analytics(分析)帐户级别分析访问权限!

I'm pretty sure the service account email address I'm using to build credentials object has sufficient Edit, Read & Analyse level access at the GA Account Level!.

我确认-get()patch()动词可以使用相同的凭据,相同的帐户和属性ID正确执行.甚至API Explorer都可以正常工作.

I confirm - get() and patch() verbs execute properly using same credentials, same account, property ID. Even the API Explorer works fine.

任何线索,我可能会缺少什么,或API中潜在的错误?

Any clue what I might be missing, or potential bug in API ?

感谢任何线索

推荐答案

我遇到了类似的问题,请注意,只能使用这些范围来列出自定义维度:

I have had a similar problem, notice that listing custom dimensions can only be done using those scopes:

[' https://www.googleapis.com/auth/analytics.readonly',' https://www.googleapis.com/auth/analytics ']

get()和patch(). com/auth/analytics.edit 作用域,我假设这是您正在使用的作用域.

get() and patch() can be done using https://www.googleapis.com/auth/analytics.edit scope, I am assuming this is the one that you are using.

这很烦人,因为编辑范围可以列出大多数资产,例如目标,但不能列出自定义维度和指标.

It is annoying as edit scope can list most of the assets such as goals but not custom dimensions and metrics.

希望能解决您的问题

这篇关于GA管理API-自定义维度list()-错误403:权限不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 10:09