Tracking code errors

Hello I have some errors with the Tracking code Wiht my firefox inpector I get whis line

The method setTrackerUrl is registered more than once in “_paq” variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers matomo.js:12:282

The method setSiteId is registered more than once in “_paq” variable. Only the last call has an effect. Please have a look at the multiple Matomo trackers documentation: https://developer.matomo.org/guides/tracking-javascript-guide#multiple-piwik-trackers matomo.js:12:282

My code :

<script>
  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="https://xxxxxxxx/matomo/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '1']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>

But I do not understand what going on . thanks for help

With your recent post in mind, you are referring to your Wordpress Matomo Installation right?

So i assume you installed the Matomo Wordpress Plugin and you have now also added the tracking code manually?

If my assumptions are correct and I understand it correctly you don’t have to add tracking script manually the Wordpress Plugin does that automatically.

If this is not the case, I would suggest inspecting the page:

  • View source (Ctrl+U) > Ctrl+F for setSiteId or matomo.js. You’ll see it twice.

  • Or in the Console, type _paq and expand it → you’ll see duplicate [‘setTrackerUrl’, …] and [‘setSiteId’, …] entries.

  • Or the Network tab → matomo.js is loaded twice (and you’ll see two requests to matomo.php per page view).

Are there multiple code snippets pointing to the same URL and site?

thank for your answer

I’m using Joomla 6. There’s only the Matomo script (Head Script).

Only one code points to a single URL.

Mhm, ok would you mind sharing the URL per dm so I can have a quick look?

I inspected your live site with Chrome DevTools and I can confirm there are two trackers in your section of the page:

Copy A: https://www.reflex…. 1st in
Copy B: //www.reflex… last thing before

I guess you are using YOOtheme Pro and you added copy A like that: Joomla admin > System > Site Templates > YOOtheme (open the customizer) > Settings > Scripts

While copy B looks very similar to how how a Joomla Matomo plugin is injecting the code.

Can you confirm its the YOOtheme and Joomla admin > System > Manage > Plugins has the Matomo Plugin installed?

If this is the case, you can safely remove one of those tracking scripts probably Copy A would be my candidate to remove.

Yes, I’m using Yootheme Pro and Joomla 6, and I put the code in the Yootheme Joomla settings – Administration Panel/Yootheme/Settings/Script. I confirm that the Matomo plugin is correctly installed in Joomla (in the administration panel: System > Manage > Plugins). I removed the code that was in the Yootheme settings. Apparently, the “error” has disappeared.

Perfect. That meant that the Joomly Matomo Plugin itself also injects its tracking code, so no need to add the custom tracking code in the header section.

Great to hear that it worked.

Hello,Thank you so much .