Capture all keywords in sitesearch

Hi there,

I would like to know the words visitors use to do a search on my site.

I found this javascript trackSiteSearch manual but I don’t understand it completely.
When I read this manual I get the impression that I need to enter all possible keywords in the site itself

_paq.push([‘trackSiteSearch’,
// Search keyword searched for
“Banana”,

This is strange to me as how can I possible anticipate which keywords my visitors are going to use?

I would like to know how this is done?

Best regards
Guy

Hi Guy

See: Site Search Tracking and Reporting - Analytics Platform - Matomo

Hi Mattieu,

I think you gave me a wrong URL as I mentioned that in my question.

What I think I need to do is inject some code in my website on the search page.
The difficult part is to find this search page as it’s in a dynamically generated page.

Here is some code linked to our search

<input name="ctl00$ctl00$cphContent$searchbox$txtSearch" type="text" id="ctl00_ctl00_cphContent_searchbox_txtSearch" class="textbox-h3" autocomplete="off">

I hope you can help me on the way with this javascript tracksitesearch …

Thanks in advance

Further search in our website revealed this code in a searchbox.ascx.vb

If Not String.IsNullOrEmpty(txtSearch.Text) Then
If txtSearch.Text.Count < 3 Then
search = False
Debugged.Alert.Show(“Gelieve minimum 3 karakters op te geven bij de full text search”)
End If
End If

can somebody help me so I can enable sitesearch for our site?

Best Regards

I finnaly found it.
I inserted the code below in the main page and now I get local search results.
I wasn’t aware that capturing the code could be different for Chrome, Explorer or Firefox and even their versions.

This link explains how to cope with the differences.

<script type="text/javascript">
  var _paq = _paq || [];
  _paq.push(['trackSiteSearch',
    // Search keyword searched for 
	document.getElementById('ctl00_ctl00_cphContent_searchbox_txtSearch').value,
    // Search category selected in your search engine. If you do not need this, set to false
    0,
    // Number of results on the Search  results page. Zero indicates a 'No Result Search Keyword'. Set to false if you don't know
    0
]);
  _paq.push(['trackPageView']);

But where does the data go? I think it would be helpful to know what people are searching for on my site the most so I can add more content and stuff on that subject.

Is there a way to show what searches have been performed and tally them up in a table?

The data goes where you order the data to go, this can be a server at home/work or a rented solution.
The code you saw on this topic needs to go in the page where it matters for you it’s part of the jacascript tag you’ll have tp put in your website. If you can’t use javascript there other solutions to.
Installing Piwik - Analytics Platform - Matomo.
The easiest way is to put it in a general section that is on every page…

From there you can add more so you track even more …