简体   繁体   English

Google Analytics API:请求计算((403)配额错误:超出用户速率限制)

[英]Google Analytics API: Request calculation ((403) Quota Error: User Rate Limit Exceeded)

I'm writing an application for processing large amounts of google analytics data at once, and I keep bumping on the 我正在编写一个用于一次处理大量Google Analytics(分析)数据的应用程序,但我一直在努力

(403) Quota Error: User Rate Limit Exceeded

error. 错误。

I have done some research and I've found out that while the limit is 10queries/second/user, it defaults to 1. So I adjusted it to 10 in the Google console, but without any luck. 我进行了一些研究,发现限制为10个查询/秒/用户,但默认值为1。因此我在Google控制台中将其调整为10个,但没有任何运气。

I've also added sleep(0.5) between every other call I make, which would make it impossible for 10 requests to be done in 1 second, but also without any luck. 我还在我进行的其他每个调用之间添加了sleep(0.5),这将使得不可能在1秒内完成10个请求,但是也没有运气。

This seems very weird to me, and that's why I'm wondering if it might be possible that 1 call with multiple dimensions/metrics/sort filters, might be treated as multiple requests? 这对我来说似乎很奇怪,这就是为什么我想知道是否可能将带有多个维度/指标/排序过滤器的1个调用视为多个请求?

Edit: I've also looked into the UserIp and the quotaUser standard query parameters, but I'm unsure how I can add those to my request (I'm using the API to make the calls: 编辑:我也研究了UserIp和quotaUser标准查询参数,但是我不确定如何将那些添加到我的请求中(我正在使用API​​进行调用:

$analytics->data_ga->get($query);

). )。 If I understand correctly, these parameters can be used to split your quota over the users you're querying data for. 如果我理解正确,则可以使用这些参数将配额分配给查询数据的用户。 In my case that won't be helpful at all (Correct me if I'm wrong), because the problem is I'm hitting the per second-cap, and I'm not querying for more than one user in the same second. 就我而言,这根本没有帮助(如果我输入错了,请纠正我),因为问题是我达到了每秒上限,并且我在同一秒钟内查询的用户不超过一个。

Any help would be greatly appreciated 任何帮助将不胜感激

You are correct that userid won't affect the 10 per second quota. 您是正确的,该用户标识不会影响每秒10个配额。 In my earlier work, I tried the approach of adding a sleep between calls but learned the hard way that that isn't the correct solution. 在我较早的工作中,我尝试了在两次呼叫之间增加睡眠的方法,但了解到了不正确的解决方法。 The correct solution is to look for the quota error and when found then add the sleep call. 正确的解决方案是查找配额错误,并在找到错误时添加睡眠调用。 And if you still get a quota error then add a larger sleep call. 如果仍然遇到配额错误,请添加一个较大的睡眠呼叫。 I try three times in my code. 我在代码中尝试了三次。 There are other protocol errors - "backend error" I think - where Google's advice is to just try again. 还有其他协议错误-我认为是“后端错误”-Google的建议是再试一次。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Drive API上传用户速率限制 - Google drive api upload User rate limit exceeded 超过了403 Google Translate API的每日限制 - 403 Google Translate API Daily Limit Exceeded 超出用户速率限制(429个错误) - User-rate limit exceeded (429 error) 使用Google Geocoding API错误消息从地址获取经度和纬度:“您已经超出了该API的每日请求配额。” - Get latitude and longitude from address using Google Geocoding API error message: “you have exceeded your daily request quota for this api..” ERR 403-在V3中列出文件时(超出用户速率限制) - ERR 403 - (User Rate Limit Exceeded) when listing files in V3 即使使用新的用户和网站ID,也会超出Google AnalyticsAPI限制 - Google Analytics API limits exceeded, even with new user and site ID Google地理位置API - 您已超出此API的每日请求限额 - Google Geolocation API - You have exceeded your daily request quota for this API “您已经超出了该API的每日请求配额。我们建议您在Google Developers Console上注册密钥 - "You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console 返回响应403“超出每日限制”时使用的Google Cloud Translation API - Used Google Cloud Translation API When return response 403 “Daily Limit Exceeded” (403)使用google-api-php-client时超出未经身份验证的使用的每日限制 - (403) Daily Limit for Unauthenticated Use Exceeded when using google-api-php-client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM