Adblock blocks A/B testing

I noticed that some users, who has an Adblock don’t take part in my A/B tests. How can I solve this problem? Thank you

The piwik.js and piwik.php files need to be referenced by a different filename. In this example we will use the filenames matomo.php and matomo.js, these however, could be any filename.

  1. A symbolic link (symlink) needs to be created on the instance to link the new pseudonyms with piwik.js and piwik.php
$ ln -s /path/to/matomo/piwik.js /path/to/matomo/matomo.js
$ ln -s /path/to/matomo/piwik.php /path/to/matomo/matomo.php
  1. Check the symlink has worked by visiting the new URL.
example: should have the same output as 
  1. Modify your tracking code to reflect the new endpoints, also we need to force using POST rather than GET for requests.
<!-- Matomo -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */

_paq.push(['setRequestMethod', 'POST']);



_paq.push(['setRequestMethod', 'POST']);

(function() {

var u="//";

_paq.push(['setTrackerUrl', u+'matomo.php']);

_paq.push(['setSiteId', '1']);

var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];

g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);



<!-- End Matomo Code →
  1. Confirm tracking is still working with this modified JavaScript tracking code.

thanks for sharing! :grinning: :grinning: :grinning: :grinning:

You could ask them to disconnect the ad-block to participate in your A / B tests. Many of us use such applications to stop advertising that exists on the Internet. This is a response to too much advertising that currently exists on the Internet. Let’s be honest, all this advertising is already annoying us all. It’s not even quality, about casinos, porn sites, etc. Even I took out my AdBlock. I looked on a site for an article about ad blockers. I got the information from them very well. I recommend it to you too.

1 Like