Knowledge article view count does not increase when accessed in communities
|Knowledge Article Number||000232241|
|Description||Communities have the capability of giving access to Knowledge in your Salesforce Org.
Users with customer community licenses can view the knowledge articles.
Now, depending on what channel is used to view the articles, the article view counts increase.
When a customer community related license user views the article in a community, the article view count gets counted towards the Customer channel.
The count increases for the article against Internal App when viewed by an Internal User.
For more information refer to: Articles
Now, if there is no code customization and the default settings are used, the article counts go up for the article against the customer channel when accessed from community by a customer community user license. However, if a soql query is used in the controller class and the article is displayed from there, viewing the article does not update the article view count. This is because, via the standard way of viewing, the API updates the counts. When code customization is used, it does not fire the view count.
|Resolution||To make sure you are still counting the article view, you can use the UPDATE VIEWSTAT clause in the SOQL query.
A sample would look like this:
SELECT id, KnowledgeArticleId, Title FROM FAQ__kav
WHERE PublishStatus='online' and
Language = 'en_US' and
KnowledgeArticleVersion = 'kaxxxxxxxxxxxxx'
This will update the view count for the article when the query is used to retrieve the article record.