[英]Google Analytics API JavaScript show data without login to users on dashboard
I am using Google Analytics API, I have setup everything in the settings on GOOGLE account, I can fetch the values properly on pentaho dashboard successfully, but issue is that when I use any other email account to login and view the page, it says authentication issue, I have used both Immediate as True and False , but nothing works, All I want is that anyone who can view the Pentaho Dashboard can view the analytic data. 我正在使用Google Analytics(分析)API,已经在GOOGLE帐户中的设置中进行了所有设置,我可以成功在pentaho仪表板上正确获取值,但是问题是当我使用任何其他电子邮件帐户登录并查看页面时,都显示了身份验证问题,我同时使用Instant和True作为True和False ,但没有任何效果,我想要的是可以查看Pentaho仪表板的任何人都可以查看分析数据。
Note: I am using JavaScript API. 注意:我正在使用JavaScript API。
I have also passed Immediate as True on First call, then made second call to authorize function using False in response, but nothing is working for me. 我在第一次调用时也将即时传递传递为True,然后在响应中使用False进行了第二次调用以授权函数,但是对我没有任何帮助。
I also get User does not have any Google Analytic Account. 我还得到用户没有任何Google Analytic帐户。 I want it to be open for everyone...
我希望它对所有人开放...
The Javascript API requires that the user is logged in to Google and has access to your Google Analytics account. Javascript API要求用户登录到Google并有权访问您的Google Analytics(分析)帐户。 There's no way around it as far as I know.
据我所知,这是不可能的。
What you want to do is use some kind of server side code to fetch data with your credentials or a service account and store the data you want in your database. 您要做的是使用某种服务器端代码来通过您的凭据或服务帐户获取数据,并将所需的数据存储在数据库中。 Then you need to write a frontend that fetches data from the database and show to your users.
然后,您需要编写一个前端,该前端从数据库中获取数据并显示给用户。
Thankfully google has a project that makes the whole process for you it's called Google Analytics super cache . 幸运的是,google有一个项目可以为您完成整个过程,称为Google Analytics(分析)超级缓存 。 It's an appengine app that does the fetching of data and storing and make it easier to query the data to show to your not-logged-in users.
这是一个appengine应用程序,可进行数据获取和存储,并使查询数据更容易显示给未登录的用户。
https://developers.google.com/analytics/solutions/google-analytics-super-proxy https://developers.google.com/analytics/solutions/google-analytics-super-proxy
Unfortunately, in case of JS to access without logging in, it would require some other kind of access like private API code, and since JS is client side, it would appear to the public. 不幸的是,如果JS在不登录的情况下进行访问,则将需要其他某种访问方式,例如私有API代码,并且由于JS是客户端,因此它会向公众展示。
Hence in JS the only form is to access by logging in. 因此,在JS中,唯一的形式是通过登录进行访问。
On the other hand, Server side codes, like PHP would enable you to access the data with just the API code, no login is necessary. 另一方面,服务器端代码(如PHP)将使您仅使用API代码即可访问数据,而无需登录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.