简体   繁体   English

如何获取 Google Analytics Data API (GA4) 中的视图(配置文件)列表?

[英]How to get a list of views (profiles) in Google Analytics Data API (GA4)?

Help Needed -需要帮助 -

In Google v3 we have API URL https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles在 Google v3 中,我们有 API URL https://www.googleapis.com/analytics/v3/management/accounts/~all//

but how to get list of views (profiles) using Google Analytics Data API (GA4)?但是如何使用 Google Analytics Data API (GA4) 获取视图列表(配置文件)?

Thanks in advance.提前致谢。

You appear to be using the Google analytics management api account summaries list method.您似乎正在使用Google 分析管理 api 帐户摘要列表方法。 THis method and all of the management api is designed to work with Universal analytics it does not support GA4 in any way.此方法和所有管理 api 旨在与通用分析一起使用,它不以任何方式支持 GA4。

What you should be looking at is the Google Analytics Admin API accounts.list method.您应该查看的是 Google Analytics Admin API accounts.list方法。

Remember that at the time of writing this api is in Alpha and can have breaking changes in the future.请记住,在撰写本文时 api 处于 Alpha 阶段,未来可能会发生重大变化。 Also check out the Google cloud client libray还可以查看Google 云客户端库

If you need any help with code let me know I have some i have been testing with but being that the library is in alpha im not sure its a good idea to put it here as its going to change in the future.如果您需要有关代码的任何帮助,请告诉我我有一些我一直在测试的,但是由于该库处于 alpha 状态,我不确定将其放在这里是个好主意,因为它会在未来发生变化。

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

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