使用Google Analytics数据显示在我们的网页上? [英] Use Google Analytics for data to display on our webpage?

本文介绍了使用Google Analytics数据显示在我们的网页上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们的部分页面上,我们会显示一些统计信息,例如当前查看网页的次数,上周查看的次数等。此外,我们还有一个统计页面,其中列出了网页,按照顺序来看,这是最受欢迎的。

今天,我们只是在这些浏览量和事件数量发生变化时插入到我们的数据库中。我们还通过普通网页跟踪和API将它们发送给Google Analytics。理想情况下,我们只需查询Google Analytics的API,而不是查询我们的数据库以查看这些统计信息以显示在我们的网页上。 Google Analytics(分析)做了一个更好的工作,找出真正的独特用户是谁,并避免计算人为夸大其浏览量计数的人数(我们允许用户在我们的网站上创建页面)。 >所以问题是,如果可以使用Google Analytics的API来更新我们网页上的统计数据?如果我缓存结果更可行?或者只是偶尔更新我们的统计信息?我非常喜欢Google Analytics的网站指标,但也许有更好的解决方案来满足这种特殊需求?

那么问题在于是否可以使用Google Analytics的API来更新我们网页上的统计信息?


是的。但是,身份验证过程和xml返回可能会减慢速度。你可以通过限制返回的行/列来加速它。另外,对于想要显示数据的方式(如果我正确理解您的方式)进行身份验证,则需要使用客户端身份验证方法。您发送用户名和密码。安全是一个问题。



我已经完成了您所描述的内容,但必须在页面上添加一个加载图形以获取统计信息。


如果我缓存结果更可行吗?或只是偶尔更新我们的统计信息?


任何一个,但缓存似乎都可以工作,特别是因为GA数据不是真实的无论如何都是时间数据。您可以让api调用并存储(或处理然后存储)返回的xml以供稍后显示。

我没有这样做,但我想我可能会给它一个走。甚至可以按计划运行。


我对我们的网站指标非常满意,但也许有更好的解决方案这个特殊的需求?


有一些第三方解决方案被考虑。


On some of our pages, we display some statistics like number of times that page has been viewed today, number of times it's been viewed the past week, etc. Additionally, we have an overall statistics page where we list the pages, in order, that have been viewed the most.

Today, we just insert these pageviews and event counts into our database as they happen. We also send them to Google Analytics via normal page tracking and their API. Ideally, instead of querying our database for these stats to display on our webpages, we just query Google Analytics' API. Google Analytics does a FAR better job figuring out who the real uniques are and avoids counting people who artificially inflate their pageview counts (we allow people to create pages on our site).

So the question is if it's possible to use Google Analytics' API for updating the statistics on our webpages? If I cache the results is it more feasible? Or just occasionally update our stats? I absolutely love Google Analytics for our site metrics, but maybe there's a better solution for this particular need?

解决方案

So the question is if it's possible to use Google Analytics' API for updating the statistics on our webpages?

Yes, it is. But, the authentication process and xml return may slow things up. You can speed it up by limiting the rows/columns returned. Also, authentication for the way you want to display the data (if I understood you correctly) would require you to use the client authentication method. You send the username and password. Security is an issue.

I have done exactly what you described but had to put a loading graphic on the page for the stats.

If I cache the results is it more feasible? Or just occasionally update our stats?

Either one but caching seems like it would work especially since GA data is not real-time data anyway. You could make the api call and store (or process then store) the returned xml for display later.

I haven't done this but I think I might give it a go. Could even run as a scheduled job.

I absolutely love Google Analytics for our site metrics, but maybe there's a better solution for this particular need?

There are some third-party solutions (googling should root them out) but money and feasibility should be considered.

这篇关于使用Google Analytics数据显示在我们的网页上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆