Get statistics on your nodes super easy with uIncrement.
What do I get?
uIncrement comes with a data type that will list how many times your node have been visited. Today, Last 7 days, Last 30 days, Last 3 months, Last 6 months and Last 12 months. It also comes with a service class so you can access your data with your c# code.
How does it work?
You decide where and when your counter should increment. We have provide you two different increment functions, one will increment at once and the other one will create a session for the user to prevent multiple incrementation by the same user. Each node will get a maximum of 365 rows in the database. Any rows older than a year will be deleted.
Installation
Download and install uIncrement in the developer section. Add the datatype uIncrement to the documenttype you'd like to show your statistics on.
Show me the code!
// Namespace
@using uIncrement.Core.Services
// Increment
CounterService.Increment(Model.Content.Id);
// Increment with session
CounterService.IncrementWithSession(Model.Content.Id);
// Get number of views the last 7 days with Razor
@CounterService.GetValue(Model.Content.Id, 7)
// Get number of views between two dates
@CounterService.GetValueBetween(Model.Content.Id, DateTime.Parse("2016-06-01"), DateTime.Parse("2016-06-30"))
PS. Check out my other packages at
https://our.umbraco.org/member/140634
https://our.umbraco.org/projects/website-utilities/ubooking/