我想創建一個Web服務的功能,將提供我從谷歌分析的JSON響應,我打算對GA數據做一些處理,然後輸出響應給用戶誰會已請求我的服務。使用服務帳戶谷歌分析
我選擇PHP作爲我的語言,並使用google-api-php-client from google and now since we do not want to authorize every time to get Token,i thought of using Service account with which I would直接使用鍵。
我從Google下載了示例代碼,更改了客戶端ID和服務帳戶名稱和密鑰位置。
但後來這個錯誤來到
Catchable fatal error: Argument 3 passed to Google_HostedmodelsServiceResource::predict()
must be an instance of Google_Input, none given, called in /var/www/webservice/GA/serviceanalytics.php
on line 62 and defined in /var/www/webservice/GA/google-api-php-client/src/contrib/Google_PredictionService.php on line 36
我發現,第二個參數是例子就是傳遞應該是第三個參數。
那麼應該是第二個參數。一點點的見解或工作的代碼可以理解的:)
感謝
爲什麼人們會付錢給你看「你的」谷歌分析數據?他們寧願看到自己的數據?通過服務帳戶,他們可以訪問的唯一數據就是你的。 – DaImTo
Nah ....這是我的...我正在玩谷歌API的....我已經創建了一個Web應用程序,現在想測試服務帳戶 –