Popular keyword search support in kentico

Yowaraj Chhetri asked on August 22, 2018 03:47

Hi, I have a requirement of displaying popular search keyword in a search page. It can be a webpart which displays popular top 10 search keyword that users have search for until now. If 20 users have searched for "Apple", the webpart should display "Apple" as popular search keyword if this is the most popular search keyword. How to track/count which keywords are used for search. And how can this be implemented. Thanks in advance.

Recent Answers

Dawid Jachnik answered on August 22, 2018 08:23

Hi, If you have enabled Web analytics Kentico tracks that keywords used by default. Just take a look on Configuration > Reporting > Web Analytics > On-site keywords > On-site keywords - Yearly report, there you have report from whole year. You can display this report using one of Report web parts. Or you can simply grab the query and use it in Repeater for example.

Please note that id you have Web analytics enabled, take a look on setting which should be also enabled: Settings > Select your website > On-line marketing > Web analytics > Traffic sources > Track on-site keywords

2 votesVote for this answer Mark as a Correct answer

Yowaraj Chhetri answered on August 23, 2018 02:30

Hi Dawid, I am not able to get the web analytics report for on-site keyword. Is this because I did not use kentico search webpart? For my website, I have built custom search webpart using the smart search index of kentico. Thanks

0 votesVote for this answer Mark as a Correct answer

Dawid Jachnik answered on August 23, 2018 08:04

if you are using custom search web part you;re right, but you can use Kentico API to log that data.

Add this code to your method in your custom search web parts before Searching takes place

CMS.WebAnalytics.AnalyticsHelper.LogOnSiteSearchKeywords(SiteContext.CurrentSiteName, DocumentContext.CurrentAliasPath,CultureHelper.PreferredUICultureCode, searchKeword, 0, 1);

it should fill up on-site report.

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.