How do I add a referral exclusion in Matomo?
Excluding referrers can be needed when using external payment providers (like PayPal) or other services like SSO. Visitors or their conversions might get attributed to those services when a visitor returns from them.
To exclude URLs so they do not appear in your Acquisition report data (as the « Websites » channel and website referrer URLs) follow these steps:
As of Matomo 4.12.0:
To exclude referrers from being attributed to any visits or conversion on server side:
- Go to Admin > Websites(or Measurables) > Manage,
- Edit the website in question,
- Add the URLs to be excluded to your list of « Excluded referrers » for this website. Alternatively those referrer can also be added to the global list of excluded referrers within the global settings.
To prevent the JavaScript tracker from storing a referrer in the attribution cookie or sending certain referrers with tracking requests at all:
- Update the tracking code on all your pages so it includes a call to
setExcludedReferrers
with all referrers that should be excluded. - The tracking code generator will automatically include this call, if an excluded referrer is configured for the website.
Having both set up, will prevent any of such referrers from distorting your referrer attributions.
Excluding referrers using a URL parameter:
If you are able to adjust the URL the visitors are landing on, you can simply add the URL parameter ignore_referrer=1
. This will let the JavaScript tracker as well as the tracking on server side discard the referrer. In addition the URL parameter ignore_referrer=1
will be removed from the current URL before it’s tracked.
This might be the easiest solution if you are e.g. forwarding your visitors to an external service, that sends back the visitors to an URL you are able to provide.
Before Matomo 4.12.0:
- Go to Admin > Websites(or Measurables) > Manage,
- Edit the website in question,
- Add the URLs to be excluded to your list of « URLs » for this website.
For example:
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.