2
我有一个下载页面在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的情况下达到此目的的最佳方式是什么?