Only 1 domain being tracked

I’ve installed matomo in a folder on 1 of my domains. Unfortunately, it only tracks the parent site id and not other site ids. For better understanding of the problem, please refer below:

id 1 = site1/matomo
id 2 = site2
id 3 = site3

The snippet tracking javascript code are:
site 1 (www.site1.com/c_matomo)

var u="//**site1**/matomo/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '**1**']);

site 2 (www.site2.com)

var u="//**site1**/matomo/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '**2**']);

site 3 (www.site3.com)

var u="//**site1**/matomo/";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', '**3**']);

Please help.

Thank you.
Ahmad MY

Hi,

Check the Javascript console of your browser for error or blocked/failed requests.

Hi ahmadmustaphamy

Can you check if you do not restrict Matomo to a single referal domain ?
in Parameters -> Web Sites -> Settings

Leave the field empty to ensure that all domains can register data in matomo.

Dear all,
Additional info for my case:

  1. Matomo is installed on site 1 with a subfolder matomo and the web analytics is working fine.
  2. The analytics was not working for site 2 & site 3. I believe the only change here is the setSiteId (either 2 or 3), right?

Please anyone help.

Thanks in advance.