Search code examples
kentico

how can I show yesterday's page view statistics in Kentico?


I want to show yesterday page view statistics statistic in kentico10 I have used page view web part, but it doesn't include yesterday field as shown below. enter image description here

But it doesn't include yesterday field!


Solution

  • One approach would be to clone the biult in webpart (Page Views) which creates a copy of the webpart in the database and copies the code files to the filesystem. Then you would edit the StatisticsType property, add in a new value for yesterday

    Yesterday would be added in a value into the datasource:

    Kentico 12 Web Part Properties

    Then in the C# code behind of the .cs class you would edit Reload data to handle the yesterday query the way the other queries are handled.

    C# code of Kentico Page Views webpart

    You would simply set the correct fromDate, startDate, and Interval type to represent "yesterday".

    I don't recommend editing the built in webpart because that is not a 100% upgrade safe change.