On this page
What this issue is
Matomo is an analytics tool. Every website you track in it gets a number called the site ID (idSite). The tracking code on your pages includes that number so Matomo knows which site a visit belongs to.
The problem happens when the number in the code does not match the site you meant. Common causes: a tracking snippet copied from another client's site, a staging site cloned to production, a site deleted and re-created in Matomo (which gives it a new ID), or a plugin or tag setting typed in by hand with a typo.
var _paq = window._paq = window._paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u = "//analytics.example.com/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '2']); // <- must match the ID in Matomo
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
})();Why it costs you leads or sales
Matomo does not change what visitors see, so the direct impact is low. The cost is bad data. If visits go to another site's reports, your own site looks quiet and the other site gets inflated numbers. If the ID does not exist, Matomo usually rejects the hits and nothing is recorded.
Then decisions go wrong: you pause a campaign that works, or you credit the wrong page for conversions. Goals and e-commerce tracking inherit the same mistake, so lead and sales counts in Matomo can no longer be trusted.
Wrong site ID
- Your site's reports are empty or flat
- Another site's reports show visits from your pages
- Goals and conversions are missing or misplaced
- Nobody notices until someone compares numbers
Correct site ID
- Visits appear in the right site's reports
- Real-time view shows your own test visit
- Goals and e-commerce match what happened
- Reports can be compared with other tools
How to check if your site has it
Find the right ID in Matomo
Go to Administration (gear icon) > Websites > Manage. Each site shows its ID next to the name. Note the ID for the site you want.
Find the ID your page sends
Open your page, view source, and search for
setSiteId. In Matomo Tag Manager or older snippets you may seeidsite=orpiwik.jsinstead.Check the network request
Open browser DevTools > Network, reload, and filter by
matomo.php(orpiwik.php). Look at theidsiteparameter in the request. This is the value Matomo actually receives.Test in Real-time
In Matomo, open the Visitors > Real-time report for the site you expect. Visit your page in a private window. If you do not appear, check the other sites in your Matomo too.
Check every environment
Repeat on staging, production and any subdomains or landing page tools. Cloned sites often keep the old ID.
How to fix it
Change the ID in the one place that outputs the tracker. Remove duplicates, so you do not have two Matomo snippets with different IDs.
Open the Matomo plugin settings
If you use the official Matomo Analytics plugin, go to Matomo Analytics > Settings and check the connected site. For self-hosted Matomo outside WordPress, use the Tracking tab and choose the correct site ID or paste the right snippet.
Check theme and other plugins
Search your theme's header.php and any header/footer script plugin for an old Matomo snippet. Remove the duplicate.
Clear caches
Purge your caching plugin and CDN so the corrected code is served.
Open the Matomo tag
If you use a Custom HTML tag, edit the
setSiteIdvalue. If you use a community Matomo template, check its Site ID field.Use a variable
Store the ID in a constant variable so every Matomo tag uses the same value.
Preview, then publish
Use Preview mode, confirm the request has the right
idsite, then publish the container.
Edit the snippet
Change the number in
_paq.push(['setSiteId', 'X'])to the correct ID. Keep it in a shared template or config so it is not copied by hand.Use per-environment config
Set a different ID for staging and production through an environment variable rather than editing code per deploy.
Redeploy and purge cache
Deploy, then purge any CDN or server cache.
Open custom code
Go to Site settings > Custom code and check the Head code for the Matomo snippet. Also check page-level custom code in Page settings.
Correct the ID and publish
Edit
setSiteId, save, and publish the site to all domains.
How to confirm it's fixed
- Page source shows the correct
setSiteIdvalue - The
matomo.phprequest has the rightidsiteand returns a 204 or 200 response - Your private-window visit shows in Real-time for the correct site
- Nothing new appears in the wrong site's Real-time report
- Only one Matomo snippet runs on each page
- A test goal or form submission is recorded against the right site
How to prevent it happening again
- Keep a list of site names, Matomo IDs and domains in one shared document
- Never copy a snippet from another client or site without changing the ID
- Use separate Matomo sites (and IDs) for staging and production
- Store the ID in one variable or config value
- After a migration, clone or redesign, re-check the ID before launch
- Look at Real-time in Matomo after every release that touches the header or tag manager
How FunnelGuard handles this
FunnelGuard does not check this yet. It does not read your Matomo site ID or compare it with your Matomo account. A Matomo check is a possible future addition.
What FunnelGuard does today is run your real customer journeys (lead forms, checkouts, booking and chat buttons) on a schedule and check the tracking hits sent to ad and analytics platforms such as GA4, Google Ads and Meta, plus whether test leads reach your inbox and CRM. That covers the conversions that matter, but not Matomo.
To watch for a wrong Matomo ID yourself, check Visitors > Real-time after each release, and set up a Matomo email report or a dashboard for each site so a sudden drop in visits stands out. Comparing Matomo visit counts with another source, such as server logs or GA4, also shows a gap quickly.
You can start with the Free plan (1 site, 2 journeys, daily checks, no card), or ask for the free read-only website audit.
Questions people ask
Why is my Matomo showing no data?
A common cause is a wrong site ID in the tracking code, so hits go to a different site or to an ID that does not exist. Compare setSiteId in your page source with the ID under Administration > Websites > Manage. Also check that the tracker URL is correct and not blocked.
How do I find my Matomo site ID?
Log in to Matomo, open Administration (gear icon) > Websites > Manage. The ID is listed next to each site's name. It is the number the tracking code must use in setSiteId.
Can I move Matomo data from the wrong site to the right one?
Not with a simple built-in button. Matomo has no standard feature to move visits between sites. Fix the ID so new visits are recorded correctly, and note the date of the change in your reports.
Why do my Matomo visits appear in another website's reports?
The tracking code on your site probably contains the other site's ID, often from a copied snippet or a cloned site. Change setSiteId to the correct number and make sure no second Matomo snippet runs.
How do I check which site ID my page is sending to Matomo?
Open DevTools > Network, reload the page, and filter by matomo.php or piwik.php. Look at the idsite parameter in the request. That is the ID Matomo receives.
Does a wrong Matomo site ID affect my ad tracking?
No, not directly. Ad platform tags such as Google Ads or Meta are separate from Matomo. But your Matomo reports will be wrong, so any decisions based on them can be too.
Does FunnelGuard check my Matomo site ID?
No. FunnelGuard does not check Matomo yet; it is a possible future check. It does monitor your funnel steps and the tracking hits sent to major ad and analytics platforms, so for Matomo use Real-time and report checks.
Related issues
- TRK-246Plausible / Fathom / Matomo tag missingFix guide
- TRK-248Two analytics tools disagreeing on conversion countsFix guide
- TRK-238Hotjar script missing or wrong site IDFix guide
- TRK-239Microsoft Clarity missing or wrong project IDFix guide
- TRK-243Mixpanel / Amplitude / Segment events missingFix guide
- TRK-240Session recording capturing form fields (PII in recordings)Fix guide