我在php中有一个下载页面,在执行一些检查后返回一个文件,而不显示任何html:
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=xyz.exe');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize(LOCAL_FILE));
readfile(LOCAL_FILE);现在我想用google-analytics来跟踪这个页面。在不显示html的情况下实现这一点的最佳方法是什么?
发布于 2010-01-18 09:00:11
试试这个:http://www.acleon.co.uk/posts/galvanize-google-analytics-without-the-javascript/
这叫做“激化”(不知道是谁想出来的)。您可以下载类here。
显然,开发人员也在支持它,因为他两天前刚刚评论了一个bug修复。
https://stackoverflow.com/questions/2083329
复制相似问题