How to setup code to track search result with no results?

I trying to get search with no results keyword from application. But actually getting confusing with sample code.

Please find below code to track or get search keyword- Which is working good.

var _paq = _paq || [];
(function() {
var u=“http://xxxxxxxxxxx/metrics/”;
_paq.push([‘setTrackerUrl’, u+‘piwik.php’]);
_paq.push([‘setSiteId’, 2]);
var d=document, g=d.createElement(‘script’), s=d.getElementsByTagName(‘script’)[0];
g.type=‘text/javascript’; g.async=true; g.defer=true; g.src=u+‘piwik.js’; s.parentNode.insertBefore(g,s);


How to add below code:
Where should go below code and what is 15 count ? when should get execute ?
var searchCount = 15; // set this value when rendering the search result page
_paq.push([‘setCustomUrl’, document.URL + ‘&search_count=’ + searchCount]);