简体   繁体   English

Drupal / Google Analytics(分析)在跟踪下载时给出错误404

[英]Drupal / Google Analytics giving error 404 when tracking downloads

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. 我一段时间以来一直在使用Drupal Google Analytics(分析)模块(当前使用6x-3.1),但发现文件下载(在本例中为PDF)在GA中显示为404错误。 Like this: 像这样:

/404.html?page=/files/docs/pdf/filename.pdf&from=http://www.example.com/products/widgets /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? 其他人看到了吗?

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. 404错误显示为页面视图,它们几乎都是PDF文件,实际上是断开的链接。 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. 我的客户在她的PDF链接上有很多错字……这只是我在尝试跟踪下载的同时出现的错字。

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. GA不会自动进行下载跟踪,因此,为了使该内容显示在您的报告中,必须在用户单击下载链接时在某处触发页面浏览的自定义代码。 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. 无论代码在哪里,它都会将该特定值作为URL推送,或者作为默认值(如果trackPageView调用中未提供任何参数,它将使用页面的当前location.href),或者作为一个特定的推送值。

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. 因为您说的是使用Drupal模块,所以您可能应该在drupal社区中使用它,打开错误报告之类的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM