如何在图表中获取 Google 分析数据

How to get Google analytics data in chart

我想使用 PHP

在任何图表中获取 Google Analytics 数据

我已经在我的帐户中创建了一个项目并且我有

tracking code

all credentials of google Auth.

我已经关注这个link 我的跟踪代码在这里

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-xxxxxxxx-1', 'auto');
  ga('send', 'pageview');

</script>

但我不知道下一步该怎么做

正在尝试这个 首先下载.12 在您的身份验证中添加 sdndsuidds-fkmfsdfdsf-545.p12 文件 检查文件中的此代码

$google_account = array(
  'email'   => 'your-project-email@developer.gserviceaccount.com',
  'key'     => file_get_contents('file-name.p12'),
  'profile' => 'profil-id'
);