Referral exclusions

Hi,

Currently we are experiencing some issues with conversion tracking from our webshop in Matomo.*

After customers have paid for their purchase, they are sent back to our thank you page. Unfortunately, Matomo then assigns the conversion to either Paypal or the clients bank-website, in stead of the original traffic source (Google/direct/social etc.).

Google Analytics has a function called: ‘Refferals exclusions list’. You can fill this list with domains you do not want conversions being assigned to.*

Is there a similar feature in Matomo?*

Hi,

Interestingly I think this isn’t a feature in Matomo even though Matomo automatically ignores visitors with a referrer that is on the list of known referrer spammer.

But I think this should be possible to do in a very short plugin. Basically listen to the following event, check if the referrer is as it shouldn’t be and then set $excluded to true to exclude that visitor:

If I got some time left and you want to, I could show you in more detail how that plugin file would look like.

If you could help out, please do!
Take your time, we are not in a hurry. Would be great to achieve this.

Thanks in advance!

1 Like

Okay, a basic plugin would be the following (I didn’t test it):

<?php

namespace Piwik\Plugins\ExcludeUserAgents;

use Piwik\Common;
use Piwik\Tracker\Request;

class ExcludeUserAgents extends \Piwik\Plugin
{
    public function registerEvents() {
        return array(
            'Tracker.isExcludedVisit' => 'isExcludedUserAgent'
        );
    }

    public function isTrackerPlugin() {
        return true;
    }

    public function isExcludedUserAgent(&$excluded, Request $request) {
        $userAgent = $request->getUserAgent();
        $userAgent = Common::unsanitizeInputValue($userAgent);
        if ($userAgent == "test") {
            $excluded = true;
        }
    }
}

isTrackerPlugin is required as by default Matomo doesn’t load plugins that are not required during tracking.

Then you can replace the if with a regex or substring check that matches what you want.

To create the plugin you could first enable development mode and then use the generator as explained here: Setting Up: Develop - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Thank you. I will ask our developer for help.

1 Like

Could I assign the conversion to the first referrer instead? See Piwik attributes conversions to the last seen referrer by default. How do I credit conversions to the first referrer instead? FAQ - Analytics Platform - Matomo

‘setConversionAttributionFirstReferrer’ does not solve the problem because the conversion for returning visitors is assigned to the referral source from the first visit, right?

Would you recommend the multi channel conversion attribution plugin?

Best regards

But if this does exclude the visit then it sure excludes also conversion data?

(I haven’t tested the code either :slight_smile: )

We should have the data (page views, conversions etc) but the conversion should be attributed to a campaign, not to the payment gateway. I’ve been thinking about solving this with cookies…

1 Like

Did you work out a solution for excluding payment gateways so that attribution sticks with the campaign? Google Analytics allows you to do this and it’s pretty critical for using Matomo for e-commerce enabled sites.

Thanks for any information you can share!

Mark

I would also be very happy to get the possibility to exclude the payment gateways like paypal, heidelpay, and so on…
Google Analytics has such a funktion which works fine.

Thank you for your excellent work and support!

Nadine :hugs:

1 Like

Unfortunately we have the same issue, we are using the premium bundle but none of the plugins can help because paypal simply overwrites all of the campaign data of the whole session.

In other words:

  1. users arrive trough the campaign “X”
  2. they browse the website (until this point we have the correct attribution in real time)
  3. Convert trough paypal
  4. the session’s attribution changes to paypal and we loose track of the campaign “X”

Did this work out for you?

Are you still having this issue? I’m looking for a solution for the same problem.

It seems the only way to have usable data is to access the SQL database directly and create some custom reports.

Actually, it seems this has been fixed.

https://matomo.org/faq/how-to/how-do-i-add-a-referral-exclusion-in-matomo/

“Then whenever Matomo will track visits in the future, any website referrer that matches the same hostnames as the “URLs” of your website, will appear as “Direct entry” instead of “Website” referrer channel.”

I have to test this.

1 Like

With the above solution, I believe we will still lose the real referrer or campaign source? Since Matomo will count those visits as direct entry.

Is this the only solution ?

Hi @mikkop,
I have encountered the same situation as you recently, and would like to ask you about the test results according to the official instructions? Is there a successful solution to this problem? thanks

Same problem here with this referral topic.

I mean ist “cute” do put them as your own website, but thats not a solution at all, as they are then - as written in the info here: https://matomo.org/faq/how-to/how-do-i-add-a-referral-exclusion-in-matomo/ - just a direct entry and thats just worthless.

Also the
_paq.push([‘setConversionAttributionFirstReferrer’, true]);

doesnt work at all…

Cant be so hard to set - fix - the first referer in the DB and the topic is solved.

We have a similar situation - and it’s about to lose us some business :frowning:

Comparing a client’s GA report with our Matomo report we see a huge allocation of “direct entry” referrals (41% in Matomo vs 14% in GA). I can confirm I’ve set the referral url exclusion list accordingly.

Is there or will there be any resolution to this?

Thanks
Adham

Hi Ivy

Happy new year, did you find a resolution to this? We are struggling with over reported “direct entry” when we believe these to be largely cpc referrals (as reported in GA).

Many thanks
Adham