admin管理员组文章数量:1278653
I wish to access Google Analytics data through their API using Javascript. Basically I want to display on a website a list of the most visited pages for the past week/month. I can only use javascript for this.
I found this example on the official site
Is there any way of accessing Google Analytics data without authentication? Do I need to somehow load a username/password in? To be clear, I want a website (that has Google Analytics tracking) to load analytics data from its own account.
I thought there might be a way to make certain data public, then query that somehow... Or perhaps create a limited user to access it. I can find no examples of either.
I wish to access Google Analytics data through their API using Javascript. Basically I want to display on a website a list of the most visited pages for the past week/month. I can only use javascript for this.
I found this example on the official site http://code.google./p/google-api-javascript-client/wiki/Samples#Google_Analytics_API
Is there any way of accessing Google Analytics data without authentication? Do I need to somehow load a username/password in? To be clear, I want a website (that has Google Analytics tracking) to load analytics data from its own account.
I thought there might be a way to make certain data public, then query that somehow... Or perhaps create a limited user to access it. I can find no examples of either.
Share Improve this question asked Feb 6, 2013 at 13:06 martinwnetmartinwnet 5812 gold badges4 silver badges10 bronze badges 1- 1 See embeddedanalytics. (I work with pany). We have a widget specifically for this (the Top Content widget). Allows you to have clickable links to those pages. Although it is currently served in an iframe - we could also enable to work via javascript (which would allow it to conform to your css). This service works with the API and is secure. – M Schenkel Commented Oct 14, 2014 at 20:47
1 Answer
Reset to default 8You can't access GA withouth authentication for rather the same reason you cannot access you bank account without authentication (because that would allow everybody else to access your account without authentication which might cause some inconvenience).
Google provides a plete example for GA access via Javascript: https://developers.google./analytics/solutions/articles/hello-analytics-api. However I don't think that's what you want (I think for that you need to be logged in to Google to actually retrieve data).
You could however use Google Apps Script to pull data into a Google Spreadsheet and embed that into your page (at least I think that should be safe).
Updated: Google has since released the Google Analytics superProxy which allows to share Analytics data with the public safely.
本文标签: Accessing Google Analytics API data from javascript without authenticationStack Overflow
版权声明:本文标题:Accessing Google Analytics API data from javascript without authentication - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741215328a2359933.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论