Is it possible to get Google Analytics data for any website (not my website) using Google Analytics API?

谁说我不能喝 提交于 2019-12-25 03:24:29

问题


Is it possible to get Google Analytics data for any website (not my website) using Google Analytics API?

I have created Google API for Google Analytics. Then I am trying to access the Google Analytics data for a different profile id.

It is working for my profile id but not other user's profile id.


回答1:


The Google Analytics API relies on [OAuth 2.0] (https://developers.google.com/analytics/devguides/reporting/core/v3/gdataAuthorization) for authorization. This simply means that the data extraction module you created needs explicit permission to access a Google Analytics Account. Moreover, the scenario you describe about using a different Profile ID wouldn't work due to the nature in which Accounts and Profiles (Views) are [related] (https://support.google.com/analytics/answer/1009618?hl=en) to each other in Google Analytics. So for e.g. if your Google Analytics Account is linked via your email id foo@gmail.com, the profile ID that you use to query must correspond to an actual profile in your Google Analytics account. This is the reason why a random Profile ID wouldn't work.




回答2:


No. You need to be granted permission to the account or view to access it. GA has documentation here



来源:https://stackoverflow.com/questions/25664055/is-it-possible-to-get-google-analytics-data-for-any-website-not-my-website-usi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!