Any way to monitor API requests to a Google Analytics profile? - google-analytics

My application's requests to a specific GA profile continue to be denied with a '403 dailyLimitExceeded' error, even in the early morning after the quota is reset at 12am PT.
The account holder is not aware of any other authorized access that would be making requests against that quota.
Is there a way to monitor requests for a profile to understand what is using up the quota, similar to API Console monitoring for projects? Are there things that use this quota that may not be obvious?
Any help on this is greatly appreciated.

Related

calendar ERROR 403: Forbidden

When I use Google Calendar APIs calendar.events.delete and calendar.events.update, you do not have permission to execute this method.response 403 Forbidden, but I have given the permission "https://www.googleapis.com/auth /calendar", please help me, thank you.
403 error happens when you are hitting the current quota limit.
As per google support,
Google Calendar puts certain limits in place to protect our users and
infrastructure from abusive behavior. When these limits are reached by
a user, Google Calendar will go into read-only mode for that user, and
all edit actions will fail for a certain period of time. Most users
will never hit these limits, as they are well above the activity level
of a typical Calendar user.
To help you handle the errors, resolutions have been stated in the documentation.

What is the reason for the error "RESOURCE_EXHAUSTED"?

I have a wordpress blog. When I logged in to the dashboard, the following exception was highlighted at the top:
[Ga_Lib_Api_Request_Exception] There was an error while contacting Google API: { "error": { "code": 429, "message": "Insufficient tokens for quota group and limit 'AnalyticsDefaultGroupCLIENT_PROJECT-1d' of service 'analyticsreporting.googleapis.com', using the limit by ID '123******456'.", "status": "RESOURCE_EXHAUSTED", "details": [ { "#type": "type.googleapis.com/google.rpc.Help", "links": [ { "description": "Google developer console API key", "url": "https://console.developers.google.com/project/207216681371/apiui/credential"}]}]}}
From the exception message I could infer that it is something related to Google Analytics and its API.
However, I'm curious to know what could have caused this exception. Also, what steps can I take in order to avoid such exceptions?
Manoj gave you the technical information I am going to give you a bit of extra info and answer the following part of your question.
However, I'm curious to know what could have caused this exception. Also, what steps can I take in order to avoid such exceptions?
When we as developers want to access Google APIs we need to register our application with Google. Each API has a different quota that the developers need to keep track of.
a quota is the number of requests you can make to an API.
For example: Considering the Google analytics by default each user of an application can make a maximum of 10 requests a second this is to prevent flooding the servers. You can also make a maximum of 10000 requests to each Google analytics View per day. Most of the quotas are user based however there is one that is project based. RESOURCE_EXHAUSTED is one such quota.
By default the project based quota for google analytics is 50000 requests. If you have a large number of users all making requests you can quickly run out of quota. The quota on my application for example is 500000 my users run though about 70% of that each day. Once you hit this quota there is nothing that can be done the application is locked out until the quota is reset at midnight west cost USA time.
What can be done to avoid it. First off the author of the plugin needs to request an additional quota so that they can service their users better they should also be checking this periodically so that there users never see it. Its probably going to take them a month to get approved for additional quota. As a user you can help by only making requests that you need to make there by not using to much of the daily quota up.
As Manoj stated there is nothing you can do personally to fix this you will need to contact the author of the plugin.
A quick search concluded that the analytics plugin used by your blog may be using more hits and quota that is permissible by google analytics api
You can find error description here and quota limits here. Please get in touch with plugin developer to get this sorted.
It was caused by a WordPress plugin you are using called "Google Analytics," which is one of many plugins you can use to easily insert analytics tracking code into your page's source. You might disable it and install another plugin that does this without causing errors.
In addition, if this plugin is synchronously pulling from Google's servers on each request, it is needlessly slowing down your page load times. There is no reason why the plugin needs to do this.

Determine google application remaining global quota

In the google applications developer console I can see the global quota usage for a google API:
I would like to achieve the following:
Be able to programatically query the remaining quota, to ensure that important tasks can always be completed.
Receive some form of alert when we are approaching the quota limit.
So far I have tried configuring the 'Monitoring' section of the developer console, but all I can see are uptime checks. This question has also been asked in other areas of the interwebs but no-one has ever received an answer.
At this time there is no API for checking the quota on the Google Developer console.

Google Analytics API Quota Suddenly Decreased

My company's product depends on the Google Analytics API, and our quota was suddenly drastically reduced. Does anybody know who to contact at Google to get this fixed quickly? I've re-submitted our application for a higher quota, but if this does not get resolved ASAP, I'm going to have a bunch of angry customers.
If someone went into your project on Developer console and turned on and off the Google Analytics API it will reset the quota to the default, removing any increase you previously where granted. (Just a guess you are going to have to wait for them to re-increase you again)
Side note I should send in a feature request: It should either not reset it or it should pop up asking if you really really really want to turn it on and off.

Google Analytics quota dayshift

I'm working on a solution where we need to request the Google Analytics API quite a lot. Now the issue is I want to allocate my requests because of the day quota limits. But right now it's quite unclear when Google makes it a new day and I have another 50.000 requests to make. From the developer console report I can get a detailed picture of the daily requests used.
Does anyone knows at what time of day and in which timezone the requests are reset?
You can request that Google Extend your 50,000 quota. Note: I am not sure if they charge for this or not. You can only do this though the old Apis console for your app. I have been unable to find this feature in the new cloud developers console. (I have sent in a feature request on it)
On the right you will find a link to Request more. But you need to make sure that you don't have to many errors returning from the API this will effect weather or not they will except your request to extend.
Note: Daily quotas refresh at midnight PST.

Resources