问题
Following this Google Tutorial : https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-php
And using this PHP library : https://github.com/wanze/Google-Analytics-API-PHP
I have a little problem. I just don't find the email to use as described in the tutorial. I think the API interface has changed, and the tutorial is old.
I have created my project, activate Analytics API, and create a "Service account". It generates an email, but not in projectId-uniqueId@developer.gserviceaccount.com format.
I tried with the new email created (like name@name-1162.iam.gserviceaccount.com) but I catch this error :
invalid_grant
Is something changed ? What I am doing wrong ?
回答1:
On the page you linked there is a basic setup:
https://github.com/wanze/Google-Analytics-API-PHP
First step is,
Create a Project in the Google APIs Console: https://code.google.com/apis/console/
And that differs completely from the other guide you have. At best follow what it says on the github page.
来源:https://stackoverflow.com/questions/34340150/which-email-to-use-in-google-service-account-api