Hi, I’m using Matomo (Piwik) for some years now. Did not have many problems all those years. And if any, than I was able to resolve them. But now, after a update to the latest version of Matomo, I do not get any data from the sites monitored ? I have had a look at all settings, even installed a new download over my existing Matomo version. The Matomo is running on a Debian server. The system control does not have any error. The implemented tracking code seems ok to me. So I am out of ideas where to look at and find the problem.
Thanks for sharing the URLs, this was much easier to solve this way.
If you open your browsers developer tools, you see that the tracking code tries to load https://server.hooghwinkel.com/matomo/piwik.js as you would expect.
But for a reason only your webserver config can tell you, your webserver doesn’t deliver the piwik.js file, but instead redirects to the homepage
curl -i https://server.hooghwinkel.com/matomo/piwik.js
HTTP/1.1 302 Found
Date: Mon, 10 Dec 2018 09:42:09 GMT
Server: Apache/2.4.25 (Debian)
Location: http://www.hocom-advies.nl/
Content-Length: 300
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://www.hocom-advies.nl/">here</a>.</p>
<hr>
<address>Apache/2.4.25 (Debian) Server at server.hooghwinkel.com Port 443</address>
</body></html>
There is another independent issue in your tracking code
You are using both the normal tracking code and the image tracking code which means that every page view will be tracked twice. You should put the image tracking code in a <noscript></noscript>, so that it only loads for people who have Javascript disabled and therefore can’t use the normal tracking code.
@Lukas Thanks for the quick reply. I’m responsible for both the server config as well as for the site and matomo. I recently added an ssl certificate for https://hocom-advies. After that all the fun started
So I guess the problem must be in one of the vhost (vhost-ssl) settings of hocom-advies or server.hooghwinkel.com ? Some rewriting is interfering but for now I have no clue what could be wrong.
The other issue you mention I am aware off. But that is for later to fix.
some other strange thing I experienced after adding the https:// hocom-advies.nl vhost was that before that I could access my servers ip address which than showed a html page as some basic page for domain-names registered but not in use for a website. Now, the server ip-address is also resolving to https://hocom-advies.nl ? So the error must be in that vhost I guess?
Where is the options-ssl.apache.conf located? I did not modify that.
I currently do not see any flaw in your configs besides the ServerAlias.
But currently there is this redirection chain: http://server.hooghwinkel.com → https://server.hooghwinkel.com → http://www.hocom-advies.nl/ → https://hocom-advies.nl/
The first and the last redirect are expected and present in the configs, the middle one…well…
I now found why the strange rewrite from server. to http://www.hocom-advies.nl/ happens
There was an .htaccess file in place which redirects other visitors beside me (my ip address) towards the hocom-advies url.
So for now I disabled that rewrite. But this has been there for months. So that could not explain the problem not getting data in Matomo right?
So what’s next?