Tracker-proxy fails to track visitors

I was trying to set up the tracker proxy after javascript tracking was running successfully.
I cloned the repository into my root folder of the website. Both my Matomo server and the proxy are up and running. My server runs on PHP 5.5.38 and when I request the piwik.php, I receive an error status:

/* there was an error loading piwik.js */

I dug into the code of the proxy.php file and cannot comprehend why it would not serve the browser the piwik.js file which is accessible when I open

Is it a bug in combination with my PHP version? Am I doing something wrong?

Can anybody help me getting this up and running as I would really love to be able to track again?

Here are some of my configuration details:

<!-- Matomo code in HTML -->
<script type="text/javascript">
  var _paq = window._paq || [];
  _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
  _paq.push(["setCookieDomain", "*"]);
  _paq.push(["setDomains", ["*","*"]]);
  _paq.push(['addDownloadExtensions', "vcf"]);
  _paq.push(['enableHeartBeatTimer', 5]);
  (function() {
    var u="//";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '2']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.php'; s.parentNode.insertBefore(g,s);
<!-- End Matomo Code -->
// config file
$PIWIK_URL = '';
$PROXY_URL = '';
$TOKEN_AUTH = 'xyz32_chars/digits_hex_token';

I have working SSL certificates. I also tried setting the DEBUG_PROXY flag to true but I do not get any output even with an ini_set call before that should display the errors.

Thanks in advance for your help!

That is strange, code looks right

I got the same problem with some of my websites that used proxy script. But I didn’t touch anything! Moreover, some websites still worked with proxy script.
Matomo installed one the server “A”. Clients sites are on different hostings. So, on the side of server A didn’t changed (it’s a dedicated server). On client hostings - can’t be sure because most of them are on shared hostings, but they are different.
And now matomo doesn’t work on some of them and I also get
" /* there was an error loading piwik.js */ ".

Why? Did anyone faced with that problem? How to fix it?
I just can’t understand the nature of problem and what to do (especially if take in mind that I didn’t change anything).Why? Anyone faced with that problem and how to fix it?
I just can’t understand the nature of problem and what to do (especially if take in mind that I didn’t change anything).

I’ve debuged and found out that the problem was in SSL cert. I have Comodo SSL cert. It use AddTrust External CA Root that has been expired at 30 May 2020. So the proxy script can’t pass SSL check.
I don’t know how to fix it because in the article said that no action required. So I’ve moved to Let’s Encrypt (for matomo’s domain) and it works fine.

1 Like