douzhuang2570 2015-11-23 13:17
浏览 67
已采纳

Google Analytics - 第三方访问帐户授权

I am writing a script in which it queries Google Analytics and with the information it pulls back it creates a report.

I have went through the PHP Quickstart guide on Google Analytics website and got the developer service account set up and working.

However the problem I have run in to is that I can only access the accounts that have this email on and many other accounts I cannot add this to as I don't have permission. We cannot get the developer service account on to these accounts but we do have a company email with read permissions on their accounts.

Is there any way of querying Google Analytics through the company email instead of the developer service account? Or is there some other way of querying Google Analytics to get the information I need from their accounts?

  • 写回答

2条回答 默认 最新

  • doufubu2518 2015-11-23 13:31
    关注

    Service accounts work when you have access to the account in question, or if the owner of the account is willing to grant your service account access to the account in question by adding it as a user.

    If you cant do that then you use Oauth2 and this will require that the owner or a user of the account. Basically anyone with access goes in and authenticates your application. Hello Analytics API: PHP quickstart for web applications is the official documentation for using Oauth2. Since your company email has access to their accounts you should just be able to authenticate the application using that email and then access it.

    If you are trying to automate this. You are going to need to request offline access in order to get a refresh token then save the refresh token you will then be able to access that accounts at anytime to create your reports. without needing to reauthenticate the application.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码