Why doesn’t the transition from the referer count?

The situation is this - there is a transition with a referer in the logs (see a piece of the log), but in the counter it is displayed as a direct entry and the referer is not indicated - is this a work error or its feature?
Log example
Line 160579: 111.165.98.103 - - [09 / Jan / 2020: 21: 25: 01 +0300] “GET /?referer=OTHERSITE.com HTTP / 2.0” 200 5499 “-” "Mozilla / 5.0 (Windows NT 10.0; WOW64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 78.0.3904.108 YaBrowser / 12.19.4.25 Yowser / 2.5 Safari / 537.36 "

Line 160581: 111.165.98.103 - - [09 / Jan / 2020: 21: 25: 22 +0300] “GET /?referer=www.OTHERSITE.com HTTP / 2.0” 200 5499 “-” "Mozilla / 5.0 (Windows NT 10.0; WOW64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 78.0.3904.108 YaBrowser / 12.19.4.25 Yowser / 2.5 Safari / 537.36 "

Hi,

Matomo can’t know that you are specifying the referer via a GET parameter. The only thing it looks out of the box is the Referer HTTP header (or the JavaScript document.referrer in case of JS tracking).

If you are using JS tracking, you can fix this by rewriting _paq.push(['setReferrerUrl', previousPageUrl]); before the _paq.push(['trackPageView']); line with the previousPageUrl you extracted from the GET parameter.

If you are using Log Analytics, you have to do this server-side by writing a Matomo plugin that during tracking replaces the referer if it finds this GET paramter in the URL.

1 Like