I’ve been looking for a solution for it, but haven’t found anything, any ideas why those errors happen? I just copied the tracking code that contains the siteid and all this information.
I also double-checked that the tracking code is called once (just in case).
I know this is a month old now and maybe the OP was able to solve his issue.
But I had this problem today out of nowhere, too and Google results lead among others to this thread when searching for the exact same error msgs mentioned above with a double insertion of the piwik JS.
I had the production version as comparison to the dev version and was able to figure it out after some hours thinking it is a Piwik specific problem. But it isn’t. At last not necessarily.
I had a portion of my local code commented out, unfortunately I left a not closed HTML div element in the middle of my website leading to this specific problem. Odd as it sounds.
Not sure about the exact context it leads to this issue as a
dircetly before the tracking code doesn’t do anything.
The basic structure of my site looked like this and the underlined div before the comment lead to the issue.
<body>
<div>
<div>
<ol>
<li></li>
</ol>
</div>
<div>
<h1></h1>
[u]<div>[/u]
<!-- some code pieces commented out with HTML comment <?php /* Some PHP code commented out so that it isn't visible in the website source either */ ?> -->
<div>
<h2></h2>
<span></span>
</div>
</div>
</div>
...
<!-- Piwik tracking code below -->
...
</body>
Removing the div and the issue is gone, putting it back in, issue reappears with said error messages. It wouldn’t happen with a, span, h1 or alike, only with div, though.
So a possible solution for this issue is checking your HTML for validity. Mainly check your div or perhaps other block elements.
The reasoning for this might be more complex than I described but it may solve similar issues notheless.
Well, finally found out that my Javascript was replacing some characters on the body page and that was causing the page to reload the whole body, that is with the Piwik code in it.
I had also faced this issue… Then i find-out why this is happening.
I deploy the matomo on e-commerce store so i have deploy tracking code and
e-commerce plugin both…
So when i remove tracking code from store the error is resolve because both are tracking code… So if you are using any plugin then don’t use tracking code