简体   繁体   English

使用Google Analytics API和PHP从分析帐户获取数据

[英]Getting data from a analytics account using Google Analytics API and PHP

I'm developing a backoffice for a website in PHP. 我正在为PHP网站开发后台服务。

In that backoffice I would like to output some google analytics info refering to that site. 在该后台,我想输出一些指向该网站的Google Analytics(分析)信息。 And only that site. 而且只有那个网站。

For that, I looked into the google analytics API, but I'm having some problems that I don't know if can overcome. 为此,我调查了Google Analytics(分析)API,但遇到了一些我不知道是否可以克服的问题。

I don't want the API to ask for the user to login or authorization. 我不希望API要求用户登录或授权。 I want the API to access always the same account (mine) and not another google analytics account, so no authorization required. 我希望该API始终访问同一帐户(我的帐户),而不是其他Google Analytics(分析)帐户,因此无需授权。

Can that be done? 能做到吗 Can someone point me to a good tutorial about using the API in the context I'm looking for? 有人可以为我指出一个有关在所需上下文中使用API​​的很好的教程吗?

Thank You. 谢谢。

You can't do this with the regular API; 您不能使用常规API来执行此操作; as you mentioned, it requires the user to login. 如您所述,它要求用户登录。 However, you can do this with the Google Analytics superProxy API . 但是,您可以使用Google Analytics(分析)superProxy API进行此操作

Yes - it's possible. 是的-有可能。

You CAN connect directly to the API without it asking for authorization. 可以直接连接到API没有它要求授权。

See: Service Applications and Google Analytics API V3: Server-to-server OAuth2 authentication? 请参阅: 服务应用程序和Google Analytics API V3:服务器到服务器的OAuth2身份验证?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM