Create a page view count report
The page view count is stored in the database and is not visible unless you use the SIL Inline Script macro from the Create a page view counter example. In order to get a report of the page views you will need to get the view counts out of the database and create a report.
Create a new file in the SIL Manager called pageViewReport.sil
Paste the following code into the file editor window:
struct table { string Title; string Views; } string cql = "(type=page and Space=" + argv[0] + ")"; number [] pages = selectPages(cql); table [] tableData; for(number p in pages) { table t; t.Title = p.title; t.Views = getPersistentVar(p, "counter"); tableData += t; } return tableData;Save the file
On a new page add the SIL Table macro
Edit the macro
Select the pageViewReport.sil script for the script setting
Add "Page, View Counts" into the columns setting
Enter the key of the space the page is in for the input setting
Save the macro
Save the new page
When you view the page you should see a report similar to this one show the view counts of the pages in the space: