Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
To get any results I had to modify SiteSearchs SiteSearch.php:
public function logResults($notification) {
// ...
$actionUrl = $action->getActionUrl();
$actionName = $action->getActionName();
if (substr($actionUrl, 0, strlen($url)) == $url) {
Piwik_SiteSearch_Archive::logAction(array(
'idaction' => ($idaction),
'name' => $actionName // instead of $actionUrl because only at the actions name we an url like "search?query=cherry"
), $site['idsite'], $site, $resultCount);
}
}
}
Oddly I got no search tracking though.
After further debugging it looks as the problem occurs because piwik SiteSearch plugin misses the "data" parameter:
I cannot speak for the search plugin, but piwik implemented it in a way that the search plugin should be able to collect the data. Maybe the maintainer of the search stuff can help here. I really hope it goes into piwik core very soon... at least it is marked as "experimental" :-)
No, sadly I didn't find any solution yet. This is still an interesting feature, but I've got no free ressources to dive deeper here atm. If I find a solution I will share it here, of course!
Today the SiteSearch maintainer has fixed some bugs in the plugin and I have also fixed some lines of code in the module. Next DEV will therefore work for sure. Minimum required SiteSearch version is v0.1.6 and can be downloaded under https://github.com/BeezyT/piwik-sitesearch
Comments
Comment #1
hass commentedComment #2
hass commentedAlso backported to D6 and D5
Comment #4
haggins commentedGreat feature!
Has anyone got it working with custom_search module? It uses another url like
h**p://example.com/?q=search/node/my%20search%20pattern
Comment #5
hass commentedUrl Looks good. Must work
Comment #6
haggins commentedBut sadly it does not. I tried both "query" and "node" as search parameter with "search" as search-url. However piwik doesn't find any.
Comment #7
haggins commentedTo get any results I had to modify SiteSearchs SiteSearch.php:
Oddly I got no search tracking though.
After further debugging it looks as the problem occurs because piwik SiteSearch plugin misses the "data" parameter:
plugins/SiteSearch/SiteSearch.php
In further processing this happens:
plugins/SiteSearch/Db.php
I'm wondering how the plugin wants to track search terms without any results since $resultCount will be 0 and the same expeption will be thrown.
Comment #8
hass commentedI cannot speak for the search plugin, but piwik implemented it in a way that the search plugin should be able to collect the data. Maybe the maintainer of the search stuff can help here. I really hope it goes into piwik core very soon... at least it is marked as "experimental" :-)
Comment #9
haggins commentedI created an issue on github: https://github.com/BeezyT/piwik-sitesearch/issues/issue/26
Hope we get it working ;)
Comment #10
hass commentedAs I may not able to solve this bug, I'm cleaning up the issue queue now.
Nevertheless I'm interested if you managed to get this issue solved?
Comment #11
haggins commentedNo, sadly I didn't find any solution yet. This is still an interesting feature, but I've got no free ressources to dive deeper here atm. If I find a solution I will share it here, of course!
Were you able to reproduce the issue?
Comment #12
hass commentedNo sorry, no time.
Comment #14
hass commentedMarked #1048438: Internal site search tracking as duplicate.
Comment #15
hass commentedToday the SiteSearch maintainer has fixed some bugs in the plugin and I have also fixed some lines of code in the module. Next DEV will therefore work for sure. Minimum required SiteSearch version is v0.1.6 and can be downloaded under https://github.com/BeezyT/piwik-sitesearch