Track registered user file download

Mihir Patel asked on July 8, 2019 08:50

Once user get logged in i want to track all files download.

As documentation, Kentico only supports the tracking of file downloads for the CMS.File page type. The system can track file downloads as Page visit activities for files stored as pages of the CMS.File type in the content tree of a website.

But i found an article by Juraj Ondrus : https://devnet.kentico.com/questions/how-to-track-all-downloads-in-the-analytics-module

So i don't know the article is written in reference of which kentico version, since i unable to locate the the file \CMSPages\GetFile.aspx.cs mentioned in article in my kentico 11.

Can you please help me to get it done or google analytics is the only way?

Correct Answer

David te Kloese answered on July 8, 2019 11:33

Hi,

These (and other handlers) have been moved to internal modules. The GetFile one with the release of Kentico 9

https://docs.kentico.com/k9/release-notes-kentico-9

Removed Get... GetFile.aspx ... files, which were used to retrieve data. Modification of the these files is no longer possible because their implementation was moved into internal libraries.


Depending on your logic you could add a Global Event Handler:

https://docs.kentico.com/k11/custom-development/handling-global-events

Or use this in your code when verifying a page request is a file download. Here some help on how to add custom analytics:

https://docs.kentico.com/k11/on-line-marketing-features/configuring-and-customizing-your-on-line-marketing-features/configuring-web-analytics/web-analytics-api/adding-custom-web-analytics

A default Portal installation should have a sample Web Part with same logic located at:

CMS\CMSWebParts\WebAnalytics\CustomStatistics.ascx.cs(117)

I'm not 100% sure what the LogHit Codename is, but if you have the records already it should be easy to find out.

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.