setConversion AttributionFirstReferrer is not working

To set the attribution for a converted goal to the referrer of the first visit, I would like to use the function setConversionAttributionFirstReferrer .

At least that’s how I understood how it works, even if the documentation (here or here FAQ) isn’t very precise in this regard. But in this old issue it sounds like I want it.

I built a simple test setup to see why it doesn’t work in a more complex environment, but I notice that the referrer of the first visit is not used for the converted goal or only in a few cases.


 _paq.push(['setConversionAttributionFirstReferrer',true]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//localhost/matomo/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '1']);

Here some findings:

  • First visit: Referrer from other website, Recent visit with conversion: Referrer from campaign → Result: Attribution goes to campaign - wrong
  • First visit: Referrer from campaign, Recent visit with conversion: Referrer from other campaign–> Result: Attribution goes to recent campaign - wrong
  • First visit: Referrer from campaign, Recent visit with conversion: Referrer from other website–> Result: Attribution goes to campaign - right
  • First visit: Referrer from website, Recent visit with conversion: Referrer from other website–> Result: Attribution goes recent website - wrong

I know this is all a little complicated. But maybe someone here has experience with this function.

Here are some screenshots:


Hi @utrautma
If I am not wrong, setConversionAttributionFirstReferrer works thanks to cookie (the cookie stores the first referrer and I suppose Matomo scripts provides this referrer with further requests). Do you track with cookie?
I know there is some issue with attribution. Is it related?

At last, there is a (premium) plugin that can change the attribution rules:

Hi @heurteph-ei ,

Thank you for finding the issues.
Yes, I track with cookies and the graphic in one issue shows the complexity of the attribution model for conversions quite well. It also shows that the simplified explanations in the FAQ are not entirely correct.
169563862-c9cb78c0-a3f0-4ae8-a4ec-f4f0c64fc743

I’ll investigate this further, but from what it looks like at first glance, the attributions could be as shown in the graphic above.

1 Like