Matomo can't connect to the site I want to track

Hi all

I installed drupal and configured the Plugin.
Here some screenshots from my settings:




You may ask you why I don’t have the correct URL in the general Settings. Due to security reasons the firewall in our company blocks every connection. The URL in the general Settings is a egress Route from Openshift. As you see I also have a egress Route for the Database. The connection to the Database works fine.
The problem is the site is not connected to Matomo. Can somebody help me?

-Tom Wilhelm

So, the first issue that I see is, that you did not enter the correct setting in the Drupal plugin.

As you are tracking a SSL page you need to setup the plugin with SSL. Also you need to enter the full URL with scheme (Both is stated by the plugin itself). Also check if your Matomo really runs in the path /matomo, as you are using a subdomain I doubt that.

After you have solved that, take a look at your dev tools if you see errors connecting to Matomo.

Here is a screenshot from a working integration:

What do you mean with setup the plugin with SSL? Yes Matomo is running in the path …/matomo
The Site I want to track has SSL, the webserver where Matomo is on does not has SSL.

I guess the connection from the Site I want to track to Matomo works because if I change something in the URL I cant save the setting and I get this error:
The validation of “analysetool-matomo-dev.six-intranet-int-egress.svc/matomoo/piwik.php” failed with an exception "Client error: GET analysetool-matomo-dev.six-intranet-int-egress.svc/matomoo/piwik.php resulted in a 404 Not Found response: <!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found (truncated…) " (HTTP code 404).

This will never work. The browser will refuse to load the piwik.js file from an unsecure url.

You may be able to get around this issue if you activate the advanced setting Locally cache tracking code file in the plugin.

I activated this setting, unfortunately its still not working :frowning:
Should I try it with the SSL?

Did you checked your browsers error log? You should see a loaded piwik.js file and calls to piwik.php.

Now I have SSL. Is this the browser error log?

Yes, but you need to look at it at your Drupal site.

Its empty:


@fdellwing

Not this part of the page, you need to check if the integration works at all for you. Do you have a web developer in your company? Than please let him take a look at it. He will be able to tell you instantly if the integration works or not.

The integration works - just the connection between matomo and the connectian is not working @fdellwing

I don’t think so. Matomo is the passive part in this. It never connects to your Drupal site, all connections are coming from there. So, you need to check what happens with them. If they reach Matomo we can start looking into what is wrong, but before I can’t say a thing without access to the site.

1 Like

@fdellwing The guy who is appropriate for the firewall in our company told me the connection should work. I believe him because if I type in the URL wrong it cant access it:

If its correct its working:

You still don’t understand the point, but ok take it your way. Simply remember, that all the following is just a guess, because the main point is still not handled by you.

IF the requests hit your Matomo instance make sure you have DNT disabled, are not opted out, are not ignoring your IP address.

@fdellwing The Connection is working! What do I have to do to get the Matomo running? Could we do a Skype Call to figure out the problem?

Just to recap:

  • Your drupal website is able to connect to the Matomo API.
  • Your Matomo instance is on an intranet site, so not reachable from the internet.

Now the large question is: Are the people who visit your drupal site also on the intranet? Because the drupal plugin just includes the tracking code in the website, but the tracking code itself (in the visitors browser) needs to connect to the Matomo server to send the data there. And if your website user is on the internet and can’t access the Matomo server, they won’t be able to send the data there.

(An exception is GitHub - matomo-org/tracker-proxy: HTTP proxy for Matomo's tracker API. This script allows to track websites with Matomo without revealing to your visitors the secret Matomo server URL. which is a simple script that can be used to forward Matomo data)

Allright, now I understand. Yes thats true - the clients who access the site I want to track cant access Matomo. This connection is blocked. So now I cant use anymore the Drupal Plugin, I have to enter the JS Script manually? Correct?

It doesn’t matter if the drupal plugin or you adds the JS script. As long as the data can’t get from the visitor to the Matomo server, you won’t be able to see any reports.

So I can’t fix the Problem with this GitHub - matomo-org/tracker-proxy: HTTP proxy for Matomo's tracker API. This script allows to track websites with Matomo without revealing to your visitors the secret Matomo server URL. ?