403 Permission denied error when retrieving advanced segment

瀏覽次數:6,572 次
跳到第一則未讀訊息

Admin Dwarf

未讀,
2012年10月23日 凌晨4:01:192012/10/23
收件者:google-analytics...@googlegroups.com
Hi,

We're experiencing problems with the Google Analytics API V3 when trying to retrieve advanced segments from the Google API PHP client. It throws the following 403 exception:

(403) User does not have permission to perform operation for this advanced segment.

The strange thing is that we can successfully extract data from the same segment through the API Query Explorer, so it's definitely not a problem with the segment itself.

The service account e-mail we're using is 543570...@developer.gserviceaccount.com.

Can anybody provide some insights to this problem?

Jeetendra Soneja

未讀,
2012年10月30日 凌晨12:29:562012/10/30
收件者:google-analytics...@googlegroups.com
An advanced segment in Google Analytics belongs to the user who created it and only that user has access to the segment. Since you're using a service account, it wouldn't have access to any of the saved advanced segments.

With service accounts, you could try using dynamic segments.

Fresh Egg

未讀,
2012年11月7日 清晨7:34:522012/11/7
收件者:google-analytics...@googlegroups.com
We're having the same problem - Google.Apis.Requests.RequestError User does not have sufficient permissions for this advanced segment. [403]

We cannot use dynamic segments or filters because some of our custom segments are quite complex and generate a request longer than the maximum 2048 characters. The same requests do work with the API Query Explorer, so I guess the explorer doesn't query the API in the same way.

Is there really no way to do this with v3?

MoreVisibility

未讀,
2012年11月16日 下午1:41:412012/11/16
收件者:google-analytics...@googlegroups.com
Have hit this problem as well.

If anyone on Google API team can shed some light/patch this break, it would be most appreciated.

martbrow

未讀,
2013年1月22日 下午4:52:082013/1/22
收件者:google-analytics...@googlegroups.com
Is this behaviour by design?  I have run into the same issue described by everyone else on this thread.

The only segments returned are the 13 negatively numbered default segments.  I have tried adding new advanced segments to see if it was related to advanced segments created before the access was granted to the nnn...@developer.gserviceaccount.com type account.

Nick Blexrud

未讀,
2013年2月19日 下午3:47:072013/2/19
收件者:google-analytics...@googlegroups.com
Getting same error. Works with Query Explorer, but not with the API request. Anybody figure out a work around?

Nick Blexrud

未讀,
2013年2月20日 上午11:55:252013/2/20
收件者:google-analytics...@googlegroups.com
Figured out a temporary solution: Instead of using the advance segment, I created a new core report and simply used the filters ga:customVarValue1==example to get at the data I wanted. Required a little extra coding, but will work until this is patched.

David Kelly

未讀,
2013年3月21日 上午10:52:582013/3/21
收件者:google-analytics...@googlegroups.com
Did you find link between when the API Project and Auth Grant generation and when the advanced segments creation date?  I've also opened a bug report.  Perhaps this will help in getting rectified. 

Thanks

MoreVisibility

未讀,
2013年3月22日 上午8:04:412013/3/22
收件者:google-analytics...@googlegroups.com
Believe the issue with advanced segments is summarized in ownership.  User that creates the advanced segments will be able to use once authenticated in Reporting API queries.  If one authenticates with a different user in the API, they will only see the advanced segments they have created.

MoreVisibility

未讀,
2013年3月22日 上午8:07:012013/3/22
收件者:google-analytics...@googlegroups.com
UPDATE--- We were able to fix this by redoing the token and all is working now as expected. 

Admin Dwarf

未讀,
2013年4月16日 上午9:08:092013/4/16
收件者:google-analytics...@googlegroups.com
Are you saying you got advanced segments working for a non-owner account?
If so, did you have to do anything else than create a new token?

MoreVisibility

未讀,
2013年4月16日 上午9:49:082013/4/16
收件者:google-analytics...@googlegroups.com
Nope.  The regeneration of the token was performed via the profile that created the Advanced Segments.

Wowzamade

未讀,
2013年11月23日 下午6:30:552013/11/23
收件者:google-analytics...@googlegroups.com
Have you been able to access segments created by other accounts?

Pete

未讀,
2013年11月25日 上午11:47:272013/11/25
收件者:google-analytics...@googlegroups.com
To summarize earlier discussions:
1) A segment in Google Analytics belongs to the user who created it and only that user has access to the segment.
2) A service account will not have access to any of the saved advanced segments. For API requests you could try using dynamic segments instead.

So, a User has saved segments and those segments can be applied to any request for views (profiles) that the User has access to.

Example:
Assuming User A creates/saves a segment and User B also has saved segments and your application is authorized to access User A and B's Analytics account (i.e. they give permission to your App to access their data). The App would be able to retrieve the IDs of the saved segments for both users but you can't apply User A's segment ID to a request for User B's data. For that to work, User A would need to have access to User B's view (profile) to begin with.

Simon Tapson

未讀,
2014年2月26日 上午9:17:092014/2/26
收件者:google-analytics...@googlegroups.com
I am having exactly the same problem. My issue is that my filters/ dynamic segments are so long they exceed the GA API's maximum URL length. Has anyone found a solution to this problem yet?

Vishal Bedre

未讀,
2015年10月13日 下午3:20:412015/10/13
收件者:Google Analytics Reporting API

Need to create shared segment it will work... Cheers

回覆所有人
回覆作者
轉寄
0 則新訊息