Visits with Referrals being listed as Direct Entry

We’ve recently set Piwik up for a new website, but the referral details from at least one of the referring websites are not showing up in the reports.

I can see that the urlref parameter is being correctly set when the request is submitted to Piwik, from the Nginx log files.

 195.11.187.138 tracking.tribepad .com - [26/Oct/2017:15:33:09 +0100]
 "GET /piwik.php?action_name=
     &idsite=53
     ...
     &url=https%3A%2F%2Fexample .com%2Fpage%3Fjamietest2
     &urlref=https%3A%2F%2Fwww.external.com%2Fpage%2F1272142411
     &_id=764555e19934f6f1
     ...
     &pv_id=pEyd8Q HTTP/1.1" 200 97 "https://example.com/page?jamietest2" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"

I can also see that the referrerUrl is set in the “raw” data held by Piwik if I call Live.getLastVisitsDetails - however, at the same time, Piwik is listing the visit as a Direct Entry.

<referrerType>direct</referrerType>
<referrerTypeName>Direct Entry</referrerTypeName>
<referrerName/>
<referrerKeyword/>
<referrerKeywordPosition/>
<referrerUrl>
https://www.external.com/page/1272142411
</referrerUrl>

Why would Piwik be doing this? As per above, I can see that referral information is being set for other websites which are going to the same page, so why is this one not being picked up?

Any clues will be greatly appreciated!

Has anyone any clues? :slightly_smiling_face:

According to the Piwik glossary, Direct Entry means “Direct Entry: A visitor has entered the URL in their browser and started browsing on your website - they entered the website directly”, which is clearly not the case here!

Is this issue an old one because I am trying to use the HTTP tracking API and it just fails to record the urlref in Matomo (it is already URL encoded).