Tracking error and Matomo blocked


Configuration: Joomla 3.9.25 website, PHP 7.3.27, shared server, Matomo 4.1.1

I have been using Piwik / Matomo on my Joomla site for several years.
On 02/20/2021 I updated from Piwik 3.0.3 to Matomo 4.1.1
I enabled Matomo’s TwoFactorAuth setting on 03/16/2021 but had a problem (See the 03/17/2021 topic “Problem with the Two-Factor Authentication setting”).
After getting help disabling this TwoFactorAuth setting on 3/18/2021, I have two issues:

1 - A tracking error:

Problem: The request was not authenticated but an authentication request was presented.
Solution: Define or correct the “token_auth” in your follow-up requests
Date: Mar.16, 2021, 5:56 p.m.
Page URL: A URL of my site
Tracking URL: idsite = 1 & rec = 1 & apiv = 1 & r = 696963 & cip = & _id = 002bb1eb4b5cb747 & token_auth = __ TOKEN_AUTH __ & _ idts …

I created a new authentication token and then removed this error. But a few moments later I saw a new tracking error with the same suggested solution.

What should be done ?

2 - Matomo has not recorded anything at all since 03/16/2021.

No tracking, no statistics!

How to solve these two problems?
Thanks for your help.


I still don’t know why you are sending the token_auth with your tracking request. Are you using PHP-tracking or log analytics?


I followed the solution indicated in the tracking error. I redefined the token_auth and pasted it into Yireo’s System - Piwik plugin for Joomla that I downloaded and used during the very first Piwik installation in February 2017. Then I deleted the error but She came back.

As of February 2017, I had not copied the tracking code into the source code of my website pages and Matomo was working fine until the update to Matomo 4.1.1 on 02/20/2021. That is, I was seeing all the stats and 404 errors in my Piwik / Matomo dashboard.

Last night, before opening this topic, I took an online tutorial. I downloaded and installed the System - itcs Matomo plugin for Joomla. I pasted the JavaScript tracking code into the Tracking code field but Matomo is still stuck since the issue with the TwoFactorAuth parameter.

Code :

<! - Matomo ->
<script type = "text / javascript">
  var _paq = window._paq = window._paq || [];
  / * tracker methods like "setCustomDimension" should be called before "trackPageView" * /
  _paq.push (['trackPageView']);
  _paq.push (['enableLinkTracking']);
  (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.src = u + 'matomo.js'; s.parentNode.insertBefore (g, s);
  }) ();
<!- End Matomo Code ->

Of course, instead of there is my domain.

Am I wrong somewhere?
What’s the right way to go?