Hi,
Generally all of your suppositions are correct.
The best illustration how the file downloads are logged can be found directly in
~\CMSPages\GetFile.aspx.cs, e.g. lines like:
HitLogProvider.LogHit(HitLogProvider.FILE_DOWNLOADS, CurrentSiteName, file.FileNode.DocumentCulture, null, file.FileNode.NodeID);
As you can see, there is NodeID used. The GetFile script automatically gets the NodeID of the document whose attachment is being downloaded.
However you could also pass string argument (e.g. with alias path or the attachment filename) - it's the null argument in above LogHit method call example. Anyway, the file downloads report gets the displayed filename using the NodeID, so you would need to modify the report query(ies).
More info on custom reports and analytics can be found in
DevGuide article.
The ..
/getattachment/.. in download URL is rewritten and GetFile.aspx handles the request. However, you probably miss
one (quite important) information - the
downloads are tracked only for CMS.File document type by default.
This can be seen in the condition(s) at lines #202 and 325 of GetFile.aspx.cs (version 4.0):
.. && (file.FileNode.NodeClassName.ToLower() == "cms.file")..So to include your document's type file in file downloads, you could modify this condition(s) to include your doctype too:
.. && ((file.FileNode.NodeClassName.ToLower() == "cms.file") || (file.FileNode.NodeClassName.ToLower() == "cms.mydoctype"))This will enable logging of downloads of the document attachments of your document type. Please note you will probably need to
clear cache (preferably both application and browser's), the file download is logged only before it's in cache.
We willl try to upgrade our documentation and explicitly note the fact that only CMS.File is logged by default. Moreover, we'll try to bring KB article according to this topic - tracking custom documents attachments downloads.
Hope this will be helpful :)
We'll appreciate any comments, e.g. if you were succesful or not. Thanks.
Regards,
Zdenek C.