Files from deleted Piwk plugin causing trouble with official Matomo Plugin

Hey guys,

so this might be a bit more complicated and might not directly have to do with the current Matomo plugin but I hope to get some help.
I recently moved the domain “heuermann.de” under which my old Matomo Server was installed. Since I didn’t backup the old installation I decided to install a new Matomo Server but under a different domain. The old installation was under matomo.heuermann.de, the new installation is under analytics.webdesign-heuermann.de.
The tracking generally works but the aquisition via social media suddenly dropped from 70% to roughly 2%. This made me curious and I discovered the following javascript errors.

  • The method setTrackerUrl is registered more than once in “_paq” variable. Only the last call has an effect.
  • The method setSiteId is registered more than once in “_paq” variable. Only the last call has an effect.
  • The method enableLinkTracking is registered more than once in “_paq” variable. Only the last call has an effect.

So apparently Matomo is sending the tracked information to both installations, the old and the new one. I confrimed that by taking a look into the HTML file.

<script type="text/javascript" async="" defer="" src="//matomo.heuermann.de/piwik.js"></script>
<script type="text/javascript" async="" defer="" src="//analytics.webdesign-heuermann.de/matomo.js"></script>

The first entry shouldn’t be there. The old Matomo server was connected to the website with the old Piwik-Plugin which I deleted. I then connected the new Matomo server with the official plugin.
Somehow that javascript file survived the deinstallation of the piwik-plugin. Does anyone know how I can get rid of that old .js file?

Greetings,
Dennis

Hi,

I don’t fully understand this sentence. Which plugin were you using and which plugin are you using now? Did you maybe add the tracking code to the template of your theme?

I used the Piwik Plugin with the Old Domain matomo.heuermann.de and I am now using the official Matomo Plugin for the new domain Analytics.webdesign-heuermann.de.
I suppose the Script was added somewhere outside of the Plugin Filder. In which directory do I find the theme template?

Hi,

To word my question more clearly: Which plugin do you mean by “the Piwik Plugin” and which with “the official Matomo Plugin”.

There is this plugin called WP-Piwik or WP-Matomo which simply connects to an existing Matomo instance and inserts the tracking code into the website.

And then there is this plugin mostly called Matomo for Wordpress which is indended to be used without a Matomo instance as it contains a complete Matomo instance within the plugin (and inserts the tracking code into the site)

Both plugins are official and actively maintained, but just for another use case.

Alright, I thought the only official plugin is the on with the Matomo logo which is published by Matomo. I now deinstalled that one and reinstalled the one by Andre Bräkling. I configured the connection to analytics.webdesign-heuermann.de and deleted the cache as well as the minified css and js files. When I now load my website the problem however persists. There still is this script:

<script type="text/javascript" async="" defer="" src="//matomo.heuermann.de/piwik.js"></script>

I hope this clears things up a bit. Now the question is: how do I get rid of that script element?

Hi,

I guess the easiest way to test this out is by disabling the WP-Matomo plugin and seeing if the incorrect script still exists.

Then I would search through the whole Wordpress directory for matomo.heuermann.de to see if it is stored anywhere.

Prolem solved!
I disabled the plugin and spent hours finding the script. But it wasn’t properly enqueued so I had no chance of finding out the ID. Finally I accidentally stumbled upon the advanced settings of the site’s theme. As it turns out the previous site admin used a theme function that was hidden there to insert tracking code on top of using the WP-Piwik plugin. After disabling the function the problem is solved.

Thank you for your support :slight_smile:

1 Like