I want to access our Google Analytics account reporting using the newer v3.0, but it seems from everything that I read that in order to get a valid access token the user must lo
I did end up using the refresh tokens, they work fine. I got a oauth token by using the google api console, and then saved it.
Then I just do this before each request:
require_once 'google-api-php-client/src/apiClient.php';
require_once 'google-api-php-client/src/contrib/apiAnalyticsService.php';;
$client = new apiClient();
$client->setApplicationName('My Analytics');
$client->setClientId($this->client_id);
$client->setClientSecret($this->client_secret);
$client->setDeveloperKey($this->api_key);
$client->setScopes(array('https://www.googleapis.com/auth/analytics.readonly'));
$client->refreshToken($this->refresh_token);
$this->service = new apiAnalyticsService($client);