如何使用google-analytics和php跟踪下载页面?
问题描述:
我有一个下载页面在PHP在执行一些检查后返回一个文件,而不显示任何HTML:如何使用google-analytics和php跟踪下载页面?
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);
现在我想跟踪与谷歌,分析这个页面。在不显示html的情况下达到此目的的最佳方式是什么?
答
试试这个: http://www.acleon.co.uk/posts/galvanize-google-analytics-without-the-javascript/
其所谓的 '激励'(不知道谁想到,一升起来)。你可以下载类here。
显然,开发人员仍然支持它,因为他刚刚评论了2天前的错误修复。