管Apache日志谷歌分析? [英] Pipe Apache Logs to Google Analytics?

查看:128
本文介绍了管Apache日志谷歌分析?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道一张code,可以在服务器上运行的该管道从Apache日志数据到谷歌Analytics(分析)?我有为数众多的生成日志网站,但用户可能会反对谷歌注入跟踪codeS放进去。这可能是一个很好的方式来获得基础知识,什么东西被从那里申请,并拥有这一切排序,以便我与我的其他谷歌分析的网页。

Does anyone know of a piece of code that can run on a server that pipes the data from Apache logs into Google Analytics? I've got a bunch of websites that generate logs, but the users would likely object to injecting Google tracking codes into them. This might be a nice way to get the basics, what's being requested from where, and have it all sorted for me in with my other Google Analytics pages.

推荐答案

您可以使用新的测量协议(适用于通用分析只占)来实现服务器端解决方案。

You can use the new measurement protocol (available for universal analytics account only) to implement a serverside solution.

管道日志将可能不能很好地工作(至少如果你想要做一个批处理作业 - 我不认为你可以通过测量协议发送时间戳,所以它看起来好像所有发生命中的同时时间),但它不应该是必要的,无论如何,刚刚创建指向谷歌端点相关参数的URL,并通过发送CURL在后台(或similiar)。

Piping logs would probably not work very well (at least if you want to do a batch job - I don't think you can send a timestamp via the measurement protocol, so it would look as if all hits occured at the same time) but it shouldn't be necessary anyway, just create an url with the relevant parameters pointing to the google endpoint and sent it in the background via CURL (or similiar).

如果您在欧盟是记得的隐私准则仍然适用,你需要通知用户,并提供了一​​个退出的链接。

If you're in the European Union remember privacy guidelines still apply and you need to inform users and provide an opt-out link.

这篇关于管Apache日志谷歌分析?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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