Transcript
Page 1: Salesforce knowledge   how to track more with pkb2

How to track more with PKB2 Appexchange package?Francois LopitauxProduct Manager

@flopitaux

in/flopitaux

Page 2: Salesforce knowledge   how to track more with pkb2

Summary

• This customization allow you to store one record per article view on

PKB2. You can then create trending report about most popular

article, unique visitor report, average article view per visit and

more.

WARNING! This customization is going to create one record per

article view on your public web site. These record are going to use

data storage space. You may need to clean them based on your web

site traffic.

• Pre-requirement:

• Public Knowledge for Web (PKB2) deployed,

https://appexchange.salesforce.com/listingDetail?listingId=

a0N300000059QxXEAU

Page 3: Salesforce knowledge   how to track more with pkb2

Step 1: Define different type of Feedback

• On Article Feedback Object, create a new pick list field

named: “Type” with 2 values, Feedback and View. Set

Feedback as default.

Page 4: Salesforce knowledge   how to track more with pkb2

Step 2: Update PKB Controller

• In PKB_Controller Apex page, add a new method:

public void UpdateExternallyViewed() {

if (viewingArticle) {

String fs = (feedbackSourceOptions.contains(feedbackSource) ? feedbackSource :

null);

PKB_Article_Feedback_Deflection__c afd = new PKB_Article_Feedback_Deflection__c(

Article_ID__c = theKad.id,

Article_Number__c = theKad.articleNumber,

Article_Title__c = theKad.title,

Session_ID__c = sessionId,

Type__c = 'View',

Feedback_Source__c = fs,

Keyword_Searched__c = urlSearchQuery,

Article_URL__c = 'https://login.salesforce.com/'+ theKad.id+ '?popup=true'

);

insert afd;

}

}

Page 5: Salesforce knowledge   how to track more with pkb2

Step 3: Update VF Template to call the method.

• Edit VF Template page, by default, the page is called

“Pkb_Template”

• Add the action attribute in the apex:page:

<apex:page cache="false"

standardStylesheets="false"

showHeader="false"

sidebar="false"

standardController="KnowledgeArticle"

extensions="pkb_Controller"

action="{!UpdateExternallyViewed}">

Page 6: Salesforce knowledge   how to track more with pkb2

Step 4: Create Report and Dashboard using Article Feedback Object

• Create new Report using Article Feedback Object.

• Main useful field on Article Feedback Object:• Session ID: Automatic Cookie generated at each new web

session. It allow to track session and how many visit you get as

how many article view per visit.

• Keyword: search keyword used to find this article

• Source: page from which article has been viewed.

• Article Number, Article Title, Article ID

Page 7: Salesforce knowledge   how to track more with pkb2

Top Related