Need details on increasing google analytics quota limits - google-analytics

I am a developer and working on a website that uses Google Analytics standard account. I use core-analytics Apis (for .Net) for querying GA to fetch different details such as total page hits, unique page hits, avg. time spent on a page, last viewed date for each web object in the web site.
I need to make 2 queries for each web object to get all these details and we have a large number of such web objects to fetch data for. In past few days I have noticed that these statistics are not being retrieved for some objects. In the logs I found an exception “Quota Error: User Rate Limit Exceeded” which states that I am exceeding the quota limit.
When researched this error, I found that below are some threshold limits that are applicable to GA standard account:
General quotas:
50,000 requests per project per day
10 queries per second (QPS) per IP
Core reporting API quotas:
10,000 requests per view (profile) per day
10 concurrent requests per view (profile)
I am not sure if which of these quotas are being exceeded. But I suspect that either 10 QPS or 10,000 req/view is being exceeded.
Question 1 : Could you please let me know if there is any way by which I can increase these quota limits(even if it involves extra cost by switching to premium account).
Question 2 : If we cannot increase the quota, can anyone please guide me how can we fetch details such as total page hits, unique page hits, avg. time spent on a page, last viewed date in a single query instead of two.
Please let me know in case you need any other details from my end.

First off you cant increase either the 10 queries per second (QPS) per IP or 10,000 requests per view (profile) per day
If you rerun the request and it doesn't work then you may be hitting the 10,000 requests per view (profile) per day once you hit that its not going to work again for that profile until the next day.
If you are unable to make any requests against any views then you are probably hitting the 50 k limit which you can request an extension of. It normally takes a month or so to get an extension.
As for the 10 requests a second I suggest you slow down your application and make sure that you aren't running to fast. You can also add quota user which can help with that.

Related

How to get/show the total website visits from google analytics?

We are using google analytics on our website to record the statistics. however, we need to show the total visits is it possible to show from google analytics API? TIA
Im not sure where you want to show the total visits but if its on your website you need to remember a few things about the Google Analytics api.
The first being that there is a data latency which means that it takes between 24 -48 hours for your data to complete processing. If you attempt to request say the current visits for today then the number will not be correct. You could request the number of vists for say three days ago and get back a number that is stable.
The other issue you are going to have is with quota. If you intend to load this from the API everytime a user visits your website they you will quickly run out of quota as you can only make 10k requests against a view in a single day so depending upon how many times this page is loaded this may not work for you.
An idea would be to load the data once at night and store the data in your database some place and then load from that as then you are only making a single request to the api and are unlikely to run out of quota.
Google anlaytics reporting api v4
Yes, just get ga:sessions metric defining the time interval that interests you.
Core Reporting API: https://developers.google.com/analytics/devguides/reporting/core/v3/common-queries
The Dimensions & Metrics Explorer lists: https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/

Datorama & Google Analytics Data Stream - 403: User Rate Limit Exceeded

Having a problem where Datorama data streams connected to Google Analytics are failing due to '403: User Rate Limit Exceeded' - we have attempted to spread the credential load across different accounts but had no success with that.
Reading this article - Limits and quotas a fix is to increase the quota from 100 to 1000 requests per 100 seconds in Google Cloud Platform.
Needing some guidance on how to set up the API connection in Google Cloud Platform and the credentials needed to link the change with Google Analytics.
Has anyone else had a similar issue before?
There are a number of google quotas. These quotas are split up in project based and user based quotas. Project based quotas can be extended user based quotas can not.
Project based. (Can be increased)
50,000 requests per project per day, which can be increased.
50 write requests per project per day, which can be increased
User based: (Can NOT be increased)
10 queries per second (QPS) per IP address.
In the API Console, there is a similar quota referred to as Requests per 100 seconds per user. By default, it is set to 100 requests per 100 seconds per user and can be adjusted to a maximum value of 1,000. But the number of requests to the API is restricted to a maximum of 10 requests per second per user.
If your application makes all API requests from a single IP address (i.e., on behalf of your users), use the userIP or quotaUser parameter with each request to get full QPS quota for each user. See the standard query parameters summary for details.
1.5 queries per second (QPS) per Account ID
'403: User Rate Limit Exceeded'
Is a flood protection quota. Each user denoted by ip address or the user who is currently authenticated can max make 100 requests per 100 seconds. This number is not perfect due to clock skew. Sometimes you can make 110 requests sometimes only 90. The only thing you can do with this quota error is to slow down and implement exponential backoff. This is a user based quota and can NOT be extended. Your only option is to slow down.
Limits & Quotas

Google Analytics Management API write requests quota limit

What is the Google Analytics Management Write API quota limit? Is it 50 requests per day or 500, because the documentation states that it is 50 requests per day but when I'm filling the quota augmentation demand form, it says that it's 500 requests.
50 requests seem to be too low and it is the case for my project.
On the other hand, where can I check my daily usage of write requests? The console usage tab doesn't show it.
EDIT: Here is a screenshot of the Google Form to demand an increase in quota limits
Google form quota limits
Google Management Write API is at 500 requests per day.
The quota limits depend a lot upon which methods you are using. Please consult the Quota Limits documentation.
The following quotas apply to Management API, Core Reporting API v3, MCF Reporting API, Metadata API, User Deletion API, and Real Time Reporting API:
50,000 requests per project per day, which can be increased.
10 queries per second (QPS) per IP address.
In the API Console, there is a similar quota referred to as Requests per 100 seconds per user. By default, it is set to 100 requests per 100 seconds per user and can be adjusted to a maximum value of 1,000. But the number of requests to the API is restricted to a maximum of 10 requests per second per user.
If your application makes all API requests from a single IP address (i.e., on behalf of your users), use the userIP or quotaUser parameter with each request to get full QPS quota for each user. See the standard query parameters summary for details.
Write APIs
These quotas apply to the write (insert, update, patch, and delete) requests:
50 write requests per project per day, which can be increased
1.5 queries per second (QPS) per Account ID
actually quota
response from Google
the default quota is 50.
There used to be a whitelist so it was effectively 0 until you got whitelisted and then it was 500 (once whitelisted). We removed the whitelist and reduced it to 50 so that people can use the API without having to wait to be whitelsited. If they need more they can request additional quota.
I wonder exactly the same. I wish to get my write quota increased to 500.
From my experience, the usage of your write requests is under "Queries per day". This morning I only made 50 write requests and it now shows 50/50 000 queries for today. Doesn't really make sense...
This post won't clear up the write quota but it will show a source of the confusion - hopefully Google will clarify this
This api-quota-faqs page clarifies a number of ambiguities regarding quotas and batching (e.g. batching doesn't help with the Management API write quota).
But the 50 vs 500 ambiguity is currently still perpetuated: The current version of that page shows "Last updated April 13, 2018":
What is the maximum quota increase limit for Management API write requests?
The maximum daily quota per project for Management API write requests is 500. We normally don't grant more than 1,000 to 2,000 write requests per project per day. In some cases, we grant higher limits temporarily. Please include your justification in the quota increase request form.
That page is required reading before submitting the form to request an increase but that shows 50 - see image
Our usage metrics shows 71 successful Management API write requests for the day but we still got write quota errors - so neither 50 nor 500 is validated.
Regarding finding the usage:
(I don't see our Management API write quota listed with the other quotas)
The traffic and error metrics are found at APIs & Services > Dashboard.
Clicking on the Analytics API will take you to detailed metrics with listings by method (e.g. insert, update, etc)
URL is:
https://console.developers.google.com/apis/api/analytics.googleapis.com/metrics?project=project-id-9731708857265513301 (replace with your project id)

Analytics API: Getting Quota Limit Error on just 10000 out of the 50000 daily queries

I am using a WordPress plugin on my website to show the actual views on each post, pulling the number from Google Analytics. The plugin uses the Analytics API.
At first, it worked great. However, a few hours in, I run into an error that I have exceeded the daily request limit. The error didn't go away until the quota reset at midnight pacific time.
The thing is, I checked my quotas at the console, and I had made barely more than 10,000, nowhere near the 50,000 limit.
Quota
I was thinking of requesting to increase the quota, but since I am nowhere near the 50,000, this does not seem to be a solution. Let alone that to request an increase I should have been at about 80% of the current quota.
To avoid the problem, I can have the plugin check the post views every four hours, instead of every hour, through the plugin's settings. But, since I am supposed to have 50000 daily queries, I would prefer to update the views on an hourly basis.
I understand that the current quota at the Google Developer console is a estimate it is not 100% accurate. But could it be so much off, showing 10k when the real number is 50k?
Should I ask for an extension?
You're most likely hitting the profile quota limit, which cannot be increased.
More information here
The 10,000 requests per view (profile) per day or the 10 concurrent requests per view (profile) cannot be increased.

Google Analytics API Does Not Return Data

I've been having issues with the Google Analytics (GA) API over the past several weeks. Our application regularly (every 2h) queries the GA API for visitor numbers from clients of ours.
However, sometimes the GA API suddenly returns only 0s for page metrics that previously provided data. This doesn't happen for all websites, only for a few, occasionally. The problem always starts around midnight (GMT) and persists for up to 24 hours.
It definitely isn't a quota error, as we would have caught that. In fact, Google's API doesn't return any error at all, it just returns 0s for all requested metrics.
Has anyone experienced this issue before? How can I solve this as it's bit of a show stopper.
In the hope this also helps other people I found the answer to my question by scouring the documentation:
https://support.google.com/analytics/answer/1070983?hl=en
Processing latency is 24-48 hours. Standard accounts that send more
than 200,000 sessions per day to Google Analytics will result in the
reports being refreshed only once a day. This can delay updates to
reports and metrics for up to two days. To restore intra-day
processing, reduce the number of sessions you send to < 200,000 per
day. For Premium accounts, this limit is extended to 2 billion hits
per month.
i.e if you are querying a non premium google analytics account with more than 200,000 visitors per day you can expect there to be intermittent lags in results for the last 48 hours. This issue was observed by us as google returning 0's, rather than some error.
This makes sense from Google's perspective as data processing = cost, as such it makes sense to leave processing for large sites (which are not paying for GA anyway) for when servers are loaded less heavily.

Resources