0 votes

Counter for Page View and File Downloads (Optimized)

Umbraco Page View Counter (Optimized)

this package is a statistics counter for individual pages to display in  front end.

it's the simplest way to show how many times the page has been visited.

Note: this is an optimized way to count the page views, it uses custom database table to store data.

It doesn't save and publish every time the page is requested, so you can use it without worrying about the performance in high traffic websites.

Follow these instructions:

1.Install the Package (Developer > Packages)

2.add the below code to the page template you need to count page views

      int nodeId = Umbraco.AssignedContentItem.Id;
      string cookieName = String.Format("PageView_{0}", nodeId);
      if (Session[cookieName] == null)
          Session[cookieName] = 1;

3.add the below code in the place you need to display the counter in.



For File Download Counter

var downloadableBrochure = Model.Value<IPublishedContent>("downloadfile");
int MediaId = downloadableBrochure.Id;

<a href="@(Reflections.UmbracoUtilities.FileDownloadCounter.FileDownloadCount(Umbraco.AssignedContentItem.Id,MediaId))" target="_blank" download>Download Brochure</a>

To get file download counter





Please Note if you will uninstall the package you need to delete the below from the database:

  1. Table : ReflectionsUmbracoUtilitiesPageViewCounter
  2. Stored Procedure : ReflectionsUmbracoUtilitiesGetPageViewCount
  3. Stored Procedure : ReflectionsUmbracoUtilitiesSetPageViewCount
  4. Table : ReflectionsUmbracoUtilitiesFileDownloadCounter
  5. Stored Procedure : ReflectionsUmbracoUtilitiesGetFileDownloadCount
  6. Stored Procedure : ReflectionsUmbracoUtilitiesSetFileDownloadCount



Source code

Package owner

Omar El Sergany

Omar El Sergany

Omar has 79 karma points

Package Compatibility

This package is compatible with the following versions as reported by community members who have downloaded this package:
Untested or doesn't work on Umbraco Cloud
Version 8.10.x (untested)
Version 8.9.x (untested)
Version 8.8.x (untested)
Version 8.7.x (untested)
Version 8.6.x (untested)
Version 8.5.x (untested)
Version 8.4.x (untested)
Version 8.3.x (untested)
Version 8.2.x (untested)
Version 8.1.x (untested)
Version 8.0.x (untested)
Version 7.15.x (100%)
Version 7.14.x (untested)
Version 7.13.x (untested)
Version 7.12.x (untested)
Version 7.11.x (untested)
Version 7.10.x (untested)
Version 7.9.x (untested)
Version 7.8.x (untested)
Version 7.7.x (untested)
Version 7.6.x (untested)
Version 7.5.x (untested)
Version 7.4.x (untested)
Version 7.3.x (untested)
Version 7.2.x (untested)
Version 7.1.x (untested)
Version 7.0.x (untested)
Version 6.2.x (untested)

You must login before you can report on package compatibility.

Package Information

  • Package owner: Omar El Sergany
  • Created: 09/09/2019
  • Current version 2.1.0
  • .NET version 4.7.2
  • License MIT
  • Downloads on Our: 325