Matomo not tracking visits Properly

Hi,

we have configured matomo server properly but it is passing wrong or 0 siteId.
how to solve this issue.

Please help us out for same.

Hi,

Can you please further explain what you mean with “0 siteId”?

we are using react piwik library in our project so how we are passing siteId for our website to track vistedpage and users.

const piwik = new ReactPiwik({
url: config.MATOMO.URL,
siteId: config.MATOMO.SITEID,
trackErrors: true,
enableLinkTracking: true,
trackDocumentTitle: true
});

You can see siteid we defined 1 and 2 for prod and staging but going through logs found that sometime it is passing 0 siteId.
Now please help me out for same.

Hi,

If the issue is that ReactPiwik is not initializing the tracking code correctly, then I would report this to the ReactPiwik developer or invite them to answer here:

Also make sure that config.MATOMO.SITEID is always set in your build process.

okay let me check the build.

thanks

I have checked build and found that siteId is always set.

So please could you report to ReactPiwik developer or invite them here.

As I see in the plugin, the siteId is correctly initialized.
For the moment I don’t have any environment available to test it.
Please create a Pull Request if you find something wrong in the plugin.

1 Like