GGshow reloaded GGshow reloaded

October 19, 2015

PHP 403 Insufficient Permission in Analytics Data Import

Issue:

PHP Fatal error: Uncaught exception 'Google_Service_Exception' with message 'Error calling POST https://www.googleapis.com/upload/analytics/v3/management/accounts/.../webproperties/.../customDataSources/.../uploads?uploadType=media: (403) Insufficient Permission' in /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php:110 Stack trace: #0 /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php(62): Google_Http_REST::decodeHttpResponse(Object(Google_Http_Request), Object(Google_Client)) #1 [internal function]: Google_Http_REST::doExecute(Object(Google_Client), Object(Google_Http_Request)) #2 /base/data/home/apps/.../google-api-php-client/src/Google/Task/Runner.php(174): call_user_func_array(Array, Array) #3 /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php(46): Google_Task_Runner->run() #4 /base/data/ in /base/data/home/apps/.../google-api-php-client/src/Google/Http/REST.php on line 110

Reason:
Insufficient permission to perform an API query

Solution:

  • Ensure sufficient account permission granted for the service account (???@developer.gserviceaccount.com).
  • Ensure proper scopes defined in Service Account Authentication (Google_Auth_AssertionCredentials).
    Use Google_Service_Analytics::ANALYTICS ( or “https://www.googleapis.com/auth/analytics” ) instead of Google_Service_Analytics::ANALYTICS_READONLY ( or “https://www.googleapis.com/auth/analytics.readonly” ) if you need to perform an edit operation, e.g. Data Import.

Reference:

January 4, 2014

2014 – A new beginning

Yes I know I know, this site was missing for several months. Losing visitors/readers, site pagerank dropped to zero, pages totally been removed from Google index, this is definitely not what I wanted to see.

Blog comments flooded with spam, web hosting plan (with 1TB monthly bandwidth limit) been suspended due to “overuse”, I’ve been tied up with work, couldn’t squeeze in some time for fixing this issue, until I was required to use my year end leave.

Not mentioning what the reason, I’ve decided to migrate the blog from b2evolution (b2evo) to WordPress (self hosted), I’ll share the migration script later, migrate from shared hosting service to Google App Engine (GAE). I’ve deployed WordPress multisite up there. Look! on the cloud ^^

This is just a beginning, a new beginning. There are still enhancements required, many things to be learned, and hopefully more to be shared too.

Over Quota

Last but not least, a belated new year greeting, Happy 2014… Happy 2013A for those who avoiding inauspicious number “4”, Happy 2013S for those who believe suffix S means something better although it is the same, happy new year for all 🙂

Filed under: Logs — Tags: , , , , , , , , , , — GG @ 5:24 am

© 2024 GGSHOW | Powered by WordPress