Drupal / Google Analytics 在跟踪下载时给出错误 404
我使用 Drupal Google Analytics 模块(当前使用 6x-3.1)已有一段时间了,但发现文件下载(在本例中为 PDF)在 GA 中显示为 404 错误。像这样:
/404.html?page=/files/docs/pdf/filename.pdf&from=http://www.example.com/products/widgets
我已经确认您可以在网站,所以这不是问题。
还有其他人看过这个吗?
I've been using the Drupal Google Analytics module (currently using 6x-3.1) for some time now, but have found that file downloads (in this case, PDFs) are showing up in GA as 404 errors. Like this:
/404.html?page=/files/docs/pdf/filename.pdf&from=http://www.example.com/products/widgets
I've confirmed that you can download the files perfectly fine on the site, so that isn't an issue.
Has anyone else seen this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实上,事实证明一切都很顺利。我没有意识到下载会显示在“事件跟踪”下。显示为页面视图的 404 错误几乎都是 PDF 文件,确实是损坏的链接。我的客户的 PDF 链接上有一堆拼写错误...这只是一个巧合,它们在我开始尝试跟踪下载的同时出现。
Actually, it turns out that everything was working fine. I didn't realize that downloads show up under Event Tracking. And the 404 errors showing up as page views, which were almost exclusively PDF files, truly were broken links. My client has a bunch of typos on her PDF links... it's just a coincidence that they showed up the same time I started trying to track downloads.
GA 不会自动进行下载跟踪,因此为了将其显示在您的报告中,必须有自定义代码在用户单击下载链接时触发页面视图。无论该代码在哪里,它都会将该特定值作为 URL 推送,或者作为默认值(如果在 trackPageView 调用中未提供参数,则它使用页面的当前 location.href),或者作为专门推送的值。
既然您说您正在使用 Drupal 模块,那么您可能应该在 drupal 社区中使用它,打开错误报告或其他内容。
GA does not do automatic download tracking, so in order for that to be showing up in your reports, there has to be custom code somewhere that triggers a page view when user clicks a download link. And wherever that code is, it is pushing that specific value as the URL, either as a default value (if no argument is supplied in the trackPageView call, it uses the current location.href of the page), or as a specifically pushed value.
Since you are saying you are using a Drupal module, you should probably take it up at the drupal community, open a bug report or something.