Embed JS in page to avoid blocking

Is it possible to embed the full matomo.js inline in a page to avoid blocking by ublock ?
If so how do i pass the params to the script.

Avoiding adblockers:

First of all, you should ban “matomo” in URLs and file links:

  1. The subdomain name should not contain “matomo” (visitors.domain does the trick).
  2. Rename the files matomo/matomo.js and matomo/matomo.php to visitors.js and visitors.php.
  3. In the base script, also rename matomo.js and matomo.php to visitors.js and visitors.php.
  4. Do not name the base script matomo.js or any other name evoking a tracking (stat, track etc…)
    visitors.js does the job very well.
  5. In matomo/matomo.js, find “action_name” and replace it by “_action_name”.
    Then in matomo/matomo.php, at the beginning of the file after the comments, add :
    if(isset($_GET[’_action_name’])) {
    $_GET[‘action_name’] = $_GET[’_action_name’];
    Blockers target the “action_name” URL parameter.

In Administration => Privacy => Unenroll users => check “Disable Do Not Track” support".
If the user has set his browser not to be tracked, his visit is still counted.

Translated form French, so sorry if it is not accurate in english.

1 Like