Quantcast
Channel: Matomo forums - Latest topics
Viewing all articles
Browse latest Browse all 14068

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

$
0
0

@John_John wrote:

Hi,
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 || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(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 + '&searchcount=' + searchCount]);
_paq.push(['trackPageView']);

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 14068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>