Loading

Count the Number of Times an Article was Viewed by Internal Users

Julkaisupäivä: Sep 21, 2024
Kuvaus

Admins might want to know certain statistics about articles on how many views it got internally or externally so that they can decide to archive or keep certain articles.

Ratkaisu

There is an object in Salesforce called the KnowledgeArticleViewStat which can be used for accessing certain statistics related to the article views, like the NormalizedScore and the ViewCount.

Viewcount gives the number of unique views a published or archived article has received in the selected channel. 

A Channel is where the article is viewed:

  • AllChannels for article views across all channels.
  • App for the internal Salesforce Knowledge application.
  • Pkb for article views in public knowledge base.
  • Csp for Customer Portal.
  • Prm for article view in partner portal.


In the Developer Console, the following SOQL query example will return the count for the number of article views by internal users. We can use the Channel App since it is meant for the internal Salesforce Knowledge application. The SOQL query is as follows:

SELECT id, ViewCount from KnowledgeArticleViewStat where Channel = 'App'


 

Knowledge-artikkelin numero

000383653

 
Ladataan
Salesforce Help | Article