Hello,
It seems that Piwik doesn’t track the referrer URLs. We got only 5-10 search referers per day on Piwik, which is far less than the real numbers (according to Google Analytics 6000+ visitors came from search engines a day).
The only thing i can thin of is a redirect (e.g. from http to https on your site) interfering with the referrer data.
Maybe check the data the browser is sending to piwik. If you visit your site, it should send a request similar to https://demo.piwik.org/piwik.php?action_name=Contact the virtual drums dev team&idsite=3&rec=1&r=837126&h=19&m=28&s=3&url=http://virtual-drums.com/contact.php&urlref=http://virtual-drums.com/&_id=790b246e588ec1ed&_idts=1495128475&_idvc=1&_idn=0&_refts=0&_viewts=1495128475&send_image=1&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=0&java=0&gears=0&ag=0&cookie=1&res=1920x1080>_ms=81&pv_id=oX5oy8.
Especially look at the urlref parameter, as this is what piwik records.
I checked the segmented visitor log which came from Google, but the visit didn’t show up.
We pass a username to piwik, do you think it has to do something with this issue?
If the user is not logged in Piwik associates the visitor with the name “undefined”. Most of the case visitors coming from Google are not logged in, maybe Piwik aggregates all these people and handles it as ONE user and this is what causes this issue?
And logged out users should just have no user ID set:
var _paq = _paq || [];
<?php
// If used is logged-in then call 'setUserId'
// $userId variable must be set by the server when the user has successfully authenticated to your app.
if (isset($userId)) {
echo sprintf("_paq.push(['setUserId', '%s']);", $userId);
}
?>
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
Another advantage is that this way you can track when your users log out.