我正在尝试访问 Google Analytics 以获取我网站的页面浏览量,但由于 GA4 中的更新,我无法通过 client_secrets.json 文件访问它。我收到此错误:
"
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"errors": [
{ "message": "Login Required.",
"domain": "global",
"reason": "required",
"location": "Authorization",
"locationType": "header"
}
],
"status": "UNAUTHENTICATED",
"details": [
{
"@type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "CREDENTIALS_MISSING",
"domain": "googleapis.com",
"metadata": {
"service": "analyticsreporting.googleapis.com",
"method": "google.analytics.reporting.v4.Reporting.GetReports"
}
}
]
}
}"
我必须做什么以及如何使用属性 id 而不是视图 id?我只需要获取我所有网站页面的页面浏览量。
我的 php-v 7.3
laravel 平台 7
希望能帮到你