How Count/entries in sp_log works

Anjo1
Tera Contributor

I want to get the number of visits per day to a page item for a specified period (say 5 months). In sp_log table an entry is made for each visit but the count is given as 0. How the count is calculated for a page item? 
Related to getting the usage analytics, what are the possible values we can collect other than visit counts?
Thanks in advance.


2 REPLIES 2

sachin_namjoshi
Kilo Patron
Kilo Patron

In sp_log table, entries of Type "Task View" or "Catalog View" or "Catalog Request" (for example) all populate the ID field, which is the "sys_id" you specified.

 

Within the widgets, this is the line that does the logging:

 

$sp.logStat('Catalog View', data.sc_cat_item.sys_class_name, data.sys_id, data.sc_cat_item.name);

 

You can create a report that filters Type="myWidget" and then group by ID.

 

Regards,

Sachin

Anjo1
Tera Contributor

@sachin.namjoshi Thanks for the reply. I have added reports for pages (service portal pages) by grouping based on 'updated' field and type as 'Page view' along with a filter condition on 'Page' specifying my page name. I didn't add the script related to logStat table but I was able to get the data from sp_log table.
So is the script necessary for portal pages? I have few more doubts regarding the same.
1. What is the purpose of count column? I am seeing the value as 0 for entry related to my filter condition as specified above.

2. Do we have a proper documentation which explains the sp_log table details and uses?

3. Other than counting the visits as mentioned above, what other usage statics we can infer from sp_log table/ through other methods which Service now offers?