include('GoogleAnalyticsAPI.class.php');
$ga = new GoogleAnalyticsAPI('service');
$ga->auth->setClientId('your_client_id'); // From the APIs console
$ga->auth->setEmail('your_email_addy'); // From the APIs console
$ga->auth->setPrivateKey('/super/secure/path/to/your/privatekey.p12');
$auth = $ga->auth->getAccessToken();
我在 $ga 中获取了除 AccessToken 之外的所有值。我已经给出了所有路径、电子邮件、客户端 ID。如果我打印 $auth,则什么都没有显示。我应该怎么做才能获得访问令牌?我参考了这个网站https://github.com/wanze/Google-Analytics-API-PHP
提前致谢。