我怎样才能吸引我的客户?谷歌分析数据?
我想创建一个 SaaS,为此我需要客户的 Google Analytics 数据。我可以这样做吗?这样的事情可能吗?我找到了管理 API,但我不知道是否可以能做到吗,我也看不懂。谢谢
I want to create a SaaS, for this I need my customers' Google Analytics data. Can I do this? Is something like this possible? I found the Management API, but I don't know if I can do it, I don't even understand it. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了请求 Google 分析数据,您需要使用多个不同的 api。但您首先需要了解的是,如今 Google Analytics 有两个版本:Universal Analytics 和 Ga4。它们不可互换。
通用分析
通过管理 API,您可以查看通用的内容分析 用户有权访问的 Google 分析帐户。这只是帐户和用户。它不是通用分析帐户中的数据本身。
要查看通用分析帐户中的数据,您需要使用 Google 分析报告API。该 API 将允许您代表您的用户提取通用分析数据。
Ga4
至于GA4帐户。您需要使用 Google Analytics admin api 访问帐户信息。 Google Analytics 数据 API 可让您访问GA4 帐户。
注意:在撰写本文时,两个 GA4 api 仍处于 Beta 阶段。
授权。
所有这些系统都要求您获得帐户用户的同意才能访问他们的数据。因此,您需要实施 Oauth2 身份验证并使用适当的 google 分析范围请求访问。
In order to request Google analytics data you need to use serval different apis. But the first thing you need to understand is that there are two versions of google analytics these days Universal analytics and Ga4. They are not interchangeable.
Universal analytics
The management api will give you access to see what universal analytics google analytics accounts that the user has access to. This is just the accounts and users. It is not the data itself within a universal analytics account.
To see the data within a universal analytics account you need to use the Google analytics reporting api. This api will allow you to extract universal analytics data on behalf of your users.
Ga4
As for the GA4 accounts. you would need to use the Google analytics admin api to access account information. The Google analytics data api will give you access to the data within a GA4 account.
Note: at the time of writing both of the GA4 apis are still in Beta.
authorization.
All of these systems will require that you have the consent of a user on the account in order to access their data. So you will need to implement Oauth2 authentication and request access with the appropriate google analytics scope.
管理 API 无关紧要。如果您需要数据,则需要报告 API。位于此处:https://developers.google.com/analytics/devguides/reporting /core/v4
它需要 OAuth 2.0 身份验证。有关详细信息,请参阅:https://developers.google.com/identity/protocols/oauth2
Management API is irrelevant. If you need the data, you need the Reporting API. It's here: https://developers.google.com/analytics/devguides/reporting/core/v4
It requires OAuth 2.0 authentication. Here's more on it: https://developers.google.com/identity/protocols/oauth2