php - (403) 当我调用 Google_Service_Analytics_Profile 对象的插入时,您的项目无权访问此功能

标签 php google-analytics google-analytics-api

自从我尝试实现需要通过 php api 插入 View (配置文件)但没有成功的服务器应用程序以来已经有很长时间了。

我已在帐户和属性中授予对我的开发者帐户服务计数电子邮件的所有访问权限,并查看用户管理。我已经制作了正确的客户端对象 $client使用所有正确的键,然后这是我的代码:

$analytics = new Google_Service_Analytics($client);
$profile = new Google_Service_Analytics_Profile($client);
$profile->setName('websiteView_0.1');
$profile->setECommerceTracking(True);

try {
  $analytics->management_profiles->insert('my_account_id', 'my_property_id', $profile);

} catch (apiServiceException $e) {
  print 'There was an Analytics API service error '
      . $e->getCode() . ':' . $e->getMessage();

} catch (apiException $e) {
  print 'There was a general API error '
      . $e->getCode() . ':' . $e->getMessage();
}

这是我的错误的屏幕截图。如果我得到适当的指导,那就太好了。

enter image description here

最佳答案

您似乎没有此功能的测试版访问权限。

Account Management Write operations in the Management API (e.g. create, update, delete, patch) for Web Property, View (Profile), and Goal resources is currently available as a developer preview in limited beta. If you're interested in using these features, request access to the beta.



如果您已经申请,则需要等到您从 Google 获悉您已获得访问权限。上次我请求访问时,它花了一个多月的时间,如果您获得访问权限,您将收到谷歌的消息。

关于php - (403) 当我调用 Google_Service_Analytics_Profile 对象的插入时,您的项目无权访问此功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34678720/

相关文章:

ruby - 如何使用 google api ruby​​ gem 查询 google analytics api?

php - 使用 PHP 从 Active Directory 获取用户的全名

php - Laravel 5 上的 Compiled.php 中的 InvalidArgumentException

google-analytics - 分析中的 user_ID 跟踪

ios - Google Analytics(分析)增强型电子商务未收到收入

google-analytics - 我可以在跟踪代码中在 _addTrans 之前使用 _addItem

php - 谷歌分析 V3 API PHP

javascript - 如何确保 _gaq.push() 正常工作?

php - 具有两个外键的三个表之间的 Laravel 关系

php - 使用 Ajax 在过滤器中显示结果数的最佳方法