$client = new Google_Client();

$client->setAssertionCredentials(new Google_Auth_AssertionCredentials(
   SERVICE_EMAIL_MY, //  $serviceAccountName
   array('https://www.googleapis.com/auth/analytics.readonly'), //.readonly // 
scope
   file_get_contents(KEY_FILE_MY)  //privateKey
));

$client->setClientId(CLIENT_ID_MY);
$client->setAccessType('offline_access');
$client->setClassConfig("Google_Http_Request", "disable_gzip", true);


Работает со старым ключом p12 (достался по наследству), с новым нет, пишет:

2015-01-01Google error : - Error calling GET 
https://www.googleapis.com/analytics/v3/data/ga?ids=ga%3A73214144&start-date=2015-01-01&end-date=2017-07-20&metrics=ga%3Avisitors&dimensions=ga%3Adate:
 
(403) User does not have any Google Analytics account. 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/77414027-e60d-47e4-946b-a0bbc1cd3fb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to